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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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