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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

EXCEPT function not returning the correct details

I have two tables which are formed by extracting one similar column(STORY ID) from two different multicolumn tables. The two tables are like below:

nitin_bhatnagar_0-1669027508272.png

 

Now, I want to calculate the difference between these two and find the ones in second table that are not present in first table.

I am trying using EXCEPT('ON END STORIES', 'ON START STORIES') but this is giving me no result and just showing as blank. Is there anything I am missing here?

 

5 REPLIES 5
serpiva64
Super User
Super User

Hi,

i think that you are in the right way

serpiva64_0-1669028952543.png

I made some tests and with your data you should get blank if you swap your tables.

serpiva64_1-1669029625839.png

on other cases you should get errors (column type ecc.)

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

 and accepting it as a solution !

 

 

 

amitchandak
Super User
Super User

@Anonymous , Try only for Id

 

EXCEPT(Distinct('ON END STORIES'[Story ID]) , Distinct('ON START STORIES''[Story ID]))

 

This will not compare other columns

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Still no luck. Now if I try just on one column, I am getting all the ids from second table and not the difference between the two. It should calculate the difference between the two and return which are present in second and not the ones in first.

@Anonymous , In that case, second table to be first

EXCEPT(Distinct('ON START STORIES''[Story ID]),Distinct('ON END STORIES'[Story ID]) )

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

The result is still not coming right. I think the relationship mapping is getting ignored while finding the distinct items based upon id(may be other columns hold different values in different tables for same unique id on different dates).

 

Is it somehow possible to compare the two tables based upon unique id only while keeping other columns intact in the resultant differential table and select rest of the other columns from the second table? This way, I can find the differential ids and then their related columns from second table that follows the managed relationship(operation is: second-first, where both have multiple columns that change values except the ids). 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.