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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
nitin_bhatnagar
Resolver I
Resolver I

EXCEPT not working

I have two tables namely TABLE and TABLE (2) and I want a DIFFERENCE TABLE (TABLE (2) - TABLE) such that I want to see values from TABLE (2) that are not present in TABLE. I used EXCEPT function for this but it does not seem to work as I expected. Both the tables are identical in column headers except the values. I am also attaching a sample .pbix file. I don't understand why is this not working although the definition of EXCEPT says that it takes values from first table not present in second one. Please help.

 

Thanks

EXCEPT.NOTWORKING pbix file

1 ACCEPTED SOLUTION
m_alireza
Solution Specialist
Solution Specialist

Hi @nitin_bhatnagar ,

In the sample pbix you provided, although the columns are identical in both tables, none of the rows in TABLE (2) match what is in TABLE. Thats why the except is returning all the rows from TABLE (2). 

All the values in the row have to match for it to be excluded. 

for example, in your pbix file, even though column3 in TABLE has ijk and Column 3 in Table(2) has ijk, column1 and column2 of TABLE dont match what is in TABLE (2) for that same row. So it is not considered a match. 
notmatchedsosnotexcluded.png

When I changed the source table so they matched, you can see that the Difference Table now shows that row as excluded.
matchedsoexcluded.png

What is your expected output? That would help in coming up with a solution.

View solution in original post

2 REPLIES 2
m_alireza
Solution Specialist
Solution Specialist

Hi @nitin_bhatnagar ,

In the sample pbix you provided, although the columns are identical in both tables, none of the rows in TABLE (2) match what is in TABLE. Thats why the except is returning all the rows from TABLE (2). 

All the values in the row have to match for it to be excluded. 

for example, in your pbix file, even though column3 in TABLE has ijk and Column 3 in Table(2) has ijk, column1 and column2 of TABLE dont match what is in TABLE (2) for that same row. So it is not considered a match. 
notmatchedsosnotexcluded.png

When I changed the source table so they matched, you can see that the Difference Table now shows that row as excluded.
matchedsoexcluded.png

What is your expected output? That would help in coming up with a solution.

Thanks. That does explain why it is behaving absurdly. Now I can fiddle around with my orginial pbix. Regards.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors