Showing results for 
Search instead for 
Did you mean: 
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

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,


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. 


Super User
Super User

Hello @AdamOsmond ,


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

Attached is the sample report for your reference.



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


Go to Power BI desktop --> TransformData


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


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

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


 Advanced Editor:


And your job is done.

Attaching the file here again

I can't open the file you sent me.  

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors