Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
imani_tech
Frequent Visitor

Left Outer Join/Left Four Characters

So I'm trying to re-create the following in Power BI:

 

SELECT
i.*,
d.[EmployeeID],
d.[LOB]
FROM [dbo].[tblImport] i
LEFT JOIN [dbo].[tblDepartments] d
ON LEFT(i.[Delegate], 4) = d.[EmployeeID]

 

First, I created a calculated column to get the left 4 characters of the Delegate field, and then the Relationships button to create the relationship.  I could not create a relationship because the values in the Delegate field are not unique.

 

Second, I went to the Query Editor to try to create the LEFT JOIN  there.  I attempted to add a calculated column to get the left 4 characters of the Delegate field.  I received an error.  Here is the code I attempted:

 

Left4 = LEFT('Main Data Source'[Delegate], 4)

 

What am I doing wrong?  Am I attempting something that Power BI was not built to do?

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @imani_tech,

In the query editor the language is not DAX is M so the formulas are different you need to yse the following formula:
Text.Start([Delegate], 4)

Be aware that in power query the formulas are case sensitive so you need yo put it with the caps in first letter of each word.

Regards
MFelix

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @imani_tech,

In the query editor the language is not DAX is M so the formulas are different you need to yse the following formula:
Text.Start([Delegate], 4)

Be aware that in power query the formulas are case sensitive so you need yo put it with the caps in first letter of each word.

Regards
MFelix

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.