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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
KylieF
Frequent Visitor

Culprit of Implementing Left Join a Subset of Table

I have these two tables:

KylieF_1-1709607920822.png

I want to implement something equivalent to that in SQL:

 

select table1.EnrolmentLead_Key, table1.child_last_name, table2.guardian_last_name
from table1
left join table2 on table1.EnrolmentLead_Key = table2.EnrolmentLead_Key and table2.is_primary = 'True'

 

 And the expected result is like: 

KylieF_2-1709608114431.png

The question is how to implement in Power BI to select the data from a semantic model. If I do:

Either:

KylieF_3-1709608232160.png

Or 

KylieF_4-1709608305032.png

Neither of them work.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @KylieF ,

The Table data is shown below:

vzhouwenmsft_0-1709706922427.png

‘is_primary’: The data type is 'text'

vzhouwenmsft_1-1709706996050.png

Please follow these steps:
1. Use the following DAX expression to create a table

 

Table = SUMMARIZE ( 'Table1',
'Table1'[EnrolmentLead_Key],'Table1'[child_last_name],
"guardian_last_name",CALCULATE (MAX('Table2'[guardian_last_name]),'Table2'[EnrolementLead_Key] = EARLIER ( 'Table1'[EnrolmentLead_Key] ),'Table2'[is_primary] = "true" ))

 

2. Final output

vzhouwenmsft_2-1709707094350.png

vzhouwenmsft_4-1709707160307.png

 

 

Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @KylieF ,

The Table data is shown below:

vzhouwenmsft_0-1709706922427.png

‘is_primary’: The data type is 'text'

vzhouwenmsft_1-1709706996050.png

Please follow these steps:
1. Use the following DAX expression to create a table

 

Table = SUMMARIZE ( 'Table1',
'Table1'[EnrolmentLead_Key],'Table1'[child_last_name],
"guardian_last_name",CALCULATE (MAX('Table2'[guardian_last_name]),'Table2'[EnrolementLead_Key] = EARLIER ( 'Table1'[EnrolmentLead_Key] ),'Table2'[is_primary] = "true" ))

 

2. Final output

vzhouwenmsft_2-1709707094350.png

vzhouwenmsft_4-1709707160307.png

 

 

Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors