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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Pikachu-Power
Post Prodigy
Post Prodigy

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
Post Prodigy
Post Prodigy

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
Post Prodigy
Post Prodigy

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.