Forum Discussion
DarSz
5 years agoHelper I
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 ...
- 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
amitchandak
5 years agoSuper User
DarSz , One of the way is that you unpivot the columns into rows
https://radacad.com/pivot-and-unpivot-with-power-bi
Then you can get these answers easily