Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

SQL? DAX? Machine Learning? or what?

I have a little problem for which I am wondering what would be the right tool...   I have several versions of a dataset. Each version contains between 500,000 rows and a million.   Each dataset ...
  • v-sihou-msft's avatar
    9 years ago

    Anonymous

     

    In this scenario, since your two datasets same metadata and same number of rows, you can build the relatioinship between two tables and add a calculated column to tag if the fact data is different or not.

     

    IfDifferent = IF(Table1[Column]=RELATED(Table2[Column]),0,1)

     

    Then you just sum above column together, divide by count of total rows. To calculated it on different level, you just need to use ALLEXCEPT() as filters to group your calculation on different level.

     

    Diff Pct On Year = 
    CALCULATE(SUM(Table1[IfDifferent]),ALLEXCEPT(Table1,Table1[Year]))
    /
    CALCULATE(COUNTROWS(Table1),ALLEXCEPT(Table1,Table1[Year]))
    
    Diff Pct On Month = 
    CALCULATE(SUM(Table1[IfDifferent]),ALLEXCEPT(Table1,Table1[Month]))
    /
    CALCULATE(COUNTROWS(Table1),ALLEXCEPT(Table1,Table1[Month]))
    

    Regards,