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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Pikachu-Power
Impactful Individual
Impactful Individual

BLANK fields after left join doesnt exist

Hello all,

 

in SQL i can simply do following query

 

SELECT * FROM Table1 A

LEFT JOIN (SELECT * FROM Table2 WHERE origin = 'ANALYSE') B

ON A.PK1 = B.PK2

WHERE B.PK2 IS NULL

 

In DAX:

Measure1 =
CALCULATE(DISTINCTCOUNT(Table1[PK1]),
                    Table2[origin] = "ANALYSE",
                    Table2[PK2] = BLANK())
 
doenst work because these BLANK() fields doenst exist. Table1 <--> Table2 filters both sides. Does someone see where the mistake is?
 
When I say not equal BLANK() it works and I get the right values: 
 
Measure2 =
CALCULATE(DISTINCTCOUNT(Table1[PK1]),
                    Table2[origin] = "ANALYSE",
                    Table2[PK2] <> BLANK())
 
Must be something simple that i oversee.
 
Many thanks.
 

  

1 ACCEPTED SOLUTION
Pikachu-Power
Impactful Individual
Impactful Individual

I found a way using NATURALLEFTOUTERJOIN(Table1, Table2) and work on that with a measure. A simple relationship seems not to generate a LEFT JOIN behaviour like in SQL. Or does someone knows a way to do it without creating a new NATURALLEFTOUTERJOIN Table?

View solution in original post

1 REPLY 1
Pikachu-Power
Impactful Individual
Impactful Individual

I found a way using NATURALLEFTOUTERJOIN(Table1, Table2) and work on that with a measure. A simple relationship seems not to generate a LEFT JOIN behaviour like in SQL. Or does someone knows a way to do it without creating a new NATURALLEFTOUTERJOIN Table?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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