Forum Discussion
Betsy
Helper IV
9 years agoMax count of duplicate values?
Hi All, I have a table that looks something like this, which displays the responses students have sent to questions. I'm looking to find a MAX response count (by student) that can be filtered by ...
- 9 years ago
Hi Betsy
A general measure to give you the max response count per student is:
Max Response Count = MAXX ( VALUES ( YourTable[Student ID] ), CALCULATE ( COUNTROWS ( YourTable ) ) )
(replace YourTable with actual table name).
This will respond to filters.
If you also want a measure for the student with the max response count, it would be:
Student with Max Response Count = FIRSTNONBLANK ( TOPN ( 1, VALUES ( YourTable[Student ID] ), CALCULATE ( COUNTROWS ( YourTable ) ) ), 1 )(pattern taken from here: http://www.sqlbi.com/articles/alternative-use-of-firstnonblank-and-lastnonblank/)