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.
v-eachen-msft
Community Support
6 years agoHi tjalleph ,
I found that there is a "null" value in your table. You could add CALCULATE(MAX('Table'[Coded_answer]),FILTER('Table','Table'[Coded_answer]>=0)) to your filter.