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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
AdamOsmond
New Member

Compare two tables in Power BI

Compare two tables in Power BI

I have two tables named TableOne and TableTwo. I want to display a table or matrix in my report that will give me all the towns that are in TableOne, but not in TableTwo. In the example below I want to be able to display the three red tables. Please  see the attachment. Thank you in advance. TT

6 REPLIES 6
v-henryk-mstf
Community Support
Community Support

Hi @AdamOsmond ,


I think @PC2790  has explained the implementation steps more clearly. If there is still confusion about specific links, please point it out.

 

If the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly.


Best Regards,
Henry

 

Please help:  I want to be able to select a person from slicer numbered 1, and then any town that is not in table 2 to be listed in table 3.  Table 2 and Table 3 have a relation in a field named "Town".  Please see the picture attached here.  Thank you in advance. 

v2.jpg

PC2790
Community Champion
Community Champion

Hello @AdamOsmond ,

 

You can do it in PowerQuery using a simple Mquery code.

Attached is the sample report for your reference.

 

Thanks

I was able to open it, but I'm new to Powe BI.  Can you tell me the steps you did to get the new table? Thank you

Sure.

Go to Power BI desktop --> TransformData

PC2790_0-1640927713741.png

In home --> New Source--> Blank Query

PC2790_1-1640927799213.png

In there, go to Advanced Editor and replace all the code with:

let
    addedT1_= List.Difference(TableOne[Name],TableTwo[Name])

in
    addedT1_

 Advanced Editor:

PC2790_2-1640927914351.png

And your job is done.

Attaching the file here again

I can't open the file you sent me.  

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.