Forum Discussion

AdamOsmond's avatar
AdamOsmond
New Member
4 years ago

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

6 Replies

    • AdamOsmond's avatar
      AdamOsmond
      New Member

      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

      • PC2790's avatar
        PC2790
        Community Champion

        Sure.

        Go to Power BI desktop --> TransformData

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

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

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

         Advanced Editor:

        And your job is done.

        Attaching the file here again

  • v-henryk-mstf's avatar
    v-henryk-mstf
    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

     

    • AdamOsmond's avatar
      AdamOsmond
      New Member

      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.