Forum Discussion
tjalleph
6 years agoFrequent Visitor
Dynamic and categorized distinct counting
Hi all, I'm fairly new to Power BI and trying to do something that could be called dynamic and categorized distinct couting. A simplified sample of my data would like this: ID Category ...
- 6 years ago
Hi tjalleph ,
you can write your measures like this:
m0 = COUNTROWS ( FILTER ( ADDCOLUMNS ( VALUES ( 'Table'[ID] ); "maxCodedAnswer"; CALCULATE ( MAX ( 'Table'[Coded_answer] ) ) ); [maxCodedAnswer] = 0 ) )Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
tjalleph
6 years agoFrequent Visitor
Works like magic! Thanks again.
To make sure i understand the concept: am I right when saying that we’re creating a temporary table with the distinct IDs and the maxCodedAnswer, that is subsequently filtered on the given maximum (in the example: 0)?
-Tjalle
To make sure i understand the concept: am I right when saying that we’re creating a temporary table with the distinct IDs and the maxCodedAnswer, that is subsequently filtered on the given maximum (in the example: 0)?
-Tjalle
sturlaws
Resident Rockstar
6 years agoCorrect