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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.