Forum Discussion

Shreeram04's avatar
Shreeram04
Resolver III
4 years ago
Solved

Distinct Row Count

Hi All, My requirement is to count distinct rows.   Sample Data:   Area Country Brand A1 c1 b1 A1 c1 b1 A1 c2 b1 A1 c2 b3 A1 c2 b3 A1 c4 b2 A1 c3 b1 A1...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  Shreeram04 ,

    Here are the steps you can follow:

    1. Create measure.

    Measure =
    var _selectarea=SELECTEDVALUE('Table'[Area])
    var _selectcountry=SELECTCOLUMNS(FILTER(ALL('Table'),'Table'[Area]=_selectarea),"1",[Country])
    return
    CALCULATE(DISTINCTCOUNT('Table'[Brand]),FILTER(ALL('Table'),'Table'[Area]=_selectarea&&'Table'[Country] in _selectcountry))

    2. Result:

     

    Best Regards,

    Liu Yang

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