Forum Discussion

DaneM123's avatar
DaneM123
Frequent Visitor
8 years ago
Solved

Finding differences between tables

I've recently inherited a Power BI job and am trying to document the various tables etc. within it. I have two tables, each containing roughly 3.5 million rows. As far as I can see they are the same ...
  • v-ljerr-msft's avatar
    8 years ago

    Hi DaneM123,

     

    Based on my test, you should be able to follow steps below to compare two tables and pull out the rows that appear in one but not the other.

     

    1. Use the formula below to create a measure(you will need to replace the bold with your real table names and column names).

    Is Contained in Table 2 =
    IF (
        CONTAINS (
            Table2,
            Table2[Code], MAX ( Table1[Code] ),
            Table2[Code2], MAX ( Table1[Code2] ),
            Table2[Date], MAX ( Table1[Date] )
        ),
        1,
        0
    )

    2. Show the related columns from Table1 with which can be concatenated into a unique key on the Table visual.

     

    3. Use the the measure to apply a visual level filter([Is Contained in Table 2] is 0) on the Table visual to show only the rows that appear in Table1 but not the Table2.

     

     

    Here is the sample pbix file for your reference. :smileyhappy:

     

    Regards