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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
geekmachine811
Frequent Visitor

Power BI Equivalent of NOT IN in SQL

Hi, I have two tables that I need to do comparison from. One is a Master Table( Table_1) that contains many records and the other (Table 2) only has a certain amount.

 

I know that if I make a relationship between the two, I'll get data that exists between the two tables. However, I'm stuck in a situation where I just want records that exist on Table_2 but are not on Table_1.

 

With SQL, NOT IN would work but I don't know how to convert the same in Power BI

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@geekmachine811,

 

You can do this in Power Query or DAX.

 

Power Query using a Left Anti join:

 

DataInsights_0-1635457056066.png

 

DataInsights_1-1635457119906.png

 

DAX caclulated table:

 

CalcTable = EXCEPT ( Table2, Table1 )

 

DataInsights_2-1635457307160.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @geekmachine811 ,

 

Could you tell me if your problem has been solved by using @DataInsights 's suggestion? If it is, kindly Accept it as the solution to make the thread closed. More people will benefit from it.

 

Best Regards,
Eyelyn Qin

DataInsights
Super User
Super User

@geekmachine811,

 

You can do this in Power Query or DAX.

 

Power Query using a Left Anti join:

 

DataInsights_0-1635457056066.png

 

DataInsights_1-1635457119906.png

 

DAX caclulated table:

 

CalcTable = EXCEPT ( Table2, Table1 )

 

DataInsights_2-1635457307160.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.