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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
YBZ
Helper III
Helper III

Measure : Select values that are not appearing in other table column

Hi all,

 

I am stuck with a measure that should show the values that are not appearing in another table column. Below a sample :

 

Table1City
Paris
Barcelona
Rome
New York

 

Table2City
Paris
Barcelona
Rome
New York
Washington

 

I would now like to create a Matrix visual with the City Names that are in Table 2, but not in Table 1 (in this sample it should show Washington). Note that the real data consists of 1000 different city names.

 

Any idea?

 

Thanks

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@YBZ Would need to know much more about relationships, filters, etc. In theory, you could create a measure like this:

Measure = CONCATENATEX(EXCEPT(SELECTCOLUMNS('Table2',"City",[City]),SELECTCOLUMNS('Table1',"City",[City])),[City],", ")

That would return them as a list. Alternatively, you could create a column in table 2 like this:

Column = 
  VAR __City = [City]
  VAR __Exists = COUNTROWS(FILTER('Table1',[City] = __City))
RETURN
  IF(__Exists = BLANK(),1,0)

 

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Greg_Deckler
Community Champion
Community Champion

@YBZ That would be:

Measure = CONCATENATEX(DISTINCT(EXCEPT(SELECTCOLUMNS('Table2',"City",[City]),SELECTCOLUMNS('Table1',"City",[City]))),[City],", ")


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@YBZ Would need to know much more about relationships, filters, etc. In theory, you could create a measure like this:

Measure = CONCATENATEX(EXCEPT(SELECTCOLUMNS('Table2',"City",[City]),SELECTCOLUMNS('Table1',"City",[City])),[City],", ")

That would return them as a list. Alternatively, you could create a column in table 2 like this:

Column = 
  VAR __City = [City]
  VAR __Exists = COUNTROWS(FILTER('Table1',[City] = __City))
RETURN
  IF(__Exists = BLANK(),1,0)

 

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

thanks a lot @Greg_Deckler. I solved it with adding the column in table 2 as you proposed 🙂 

 

One question just for my understanding as the measure did not fully work as I have a lot of duplicate values in my columns. Therefore the result shows as well multiple times the same city name. 

 

When I wanted to add DISTINCT(), it created an error ... Not sure where to put to have only distinct values in my column. 

 

 

Greg_Deckler
Community Champion
Community Champion

@YBZ That would be:

Measure = CONCATENATEX(DISTINCT(EXCEPT(SELECTCOLUMNS('Table2',"City",[City]),SELECTCOLUMNS('Table1',"City",[City]))),[City],", ")


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler  thanks a lot 🙂 Much appreciated!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.