Forum Discussion

biaudit's avatar
biaudit
New Member
6 years ago

How to count differences between tables

Hey guys,

I need to count how many times a sum between values from different tables are bigger than zero.

Both tables are the same but only one columm has different values (the one I need to count). 

Do you know how can I do that?

2 Replies

  • edhans's avatar
    edhans
    Community Champion

    I would need to see the tables to understand the question fully, but this really seems best done by a merge in Power Query, then add a custom column that would show the difference. Then just use a measure like the following in DAX to show your difference count:

     

    Difference Count =
    CALCULATE (
        COUNTROWS ( tablename ),
        FILTER ( tablename, tablename[fieldname] <> 0 )
    )

     

    If you keep both tables in the model and want to do the comparison, you'll need to create calculated columns using LOOKUP and RELATEDTABLE most likely, but again, I'd have to see what the tables looked like to more fully understand the question.