Forum Discussion

FranckGbadamass's avatar
4 years ago
Solved

Need help retrieve data on two data set

Hello everyone, I have two tables, one contains all the file IDs and decision code (this table contains unique entries) and the other contains the rules that were applied to it (this one contains du...
  • v-xiaotang's avatar
    4 years ago

    Hi FranckGbadamass 

    If you want to use matrix to display the count, you can take the method mentioned by AlexisOlson, it's the fastest way. 

    If you don't want to use matrix or you just want to know how to calculate the count by DAX, try measures bellow,

    code A = 
        var  _t0=SUMMARIZE(FILTER(ALL(Table2),Table2[Rules]=MIN(Table2[Rules])),[File ID])
        var  _t1=SUMMARIZE(FILTER(ALL(Table1),Table1[Decision code] ="A"),[File ID])
        var  _t2=INTERSECT(_t1,_t0)
    return COUNTROWS(_t2)
    code R = 
        var  _t0=SUMMARIZE(FILTER(ALL(Table2),Table2[Rules]=MIN(Table2[Rules])),[File ID])
        var  _t1=SUMMARIZE(FILTER(ALL(Table1),Table1[Decision code] ="R"),[File ID])
        var  _t2=INTERSECT(_t1,_t0)
    return COUNTROWS(_t2)

    result

     

    Best Regards,

    Community Support Team _Tang

    If this post helps, please consider Accept it as the solution to help the other members find it more quickly.