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
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
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.

Top Solution Authors
Top Kudoed Authors