Forum Discussion

DarSz's avatar
DarSz
Helper I
5 years ago
Solved

Count rows for multiple columns

Hello, I have following table in pbix:   Id   |  class1  |  class2  |  ....  |  class99  1    | status1 | status2 |  ....  |  status5 2    | status2 | status2 |  ....  |  status1 3    | status3 ...
  • BA_Pete's avatar
    5 years ago

    Hi DarSz ,

     

    In Power Query, you'll want to unpivot your class columns.

    Select your [id] column, then on the Transform tab choose Unpivot Columns dropdown and select Unpivot Other Columns.

    This should get you something like this:

     

    Then your measures only need to reference the [class] (attribute) column and the [status] (Value) column.

     

    You could then create a simple measure as follows:

    _noofValues = COUNTROWS(yourTable)

     

    You can then use this measure in a matrix to show the intersect count of class vs status, something like this:

     

    Pete