Forum Discussion
sharmisaranga09
Helper I
2 years agoFind maximum occurred item for each category
Hi, I have a question and answer columns in my table, I want to find the count of unique answers for each questions and get the maximum count answer for each question Expected result is, find...
- 2 years ago
sharmisaranga09 The measure form is:
Max count Answered (measure) = VAR __Question = MAX( [Question] ) VAR __Table = SUMMARIZE( FILTER( ALL( 'Table' ), [Question] = __Question ), [Answer], "__Count", COUNTROWS( 'Table' ) ) VAR __Max = MAXX( __Table, [__Count] ) VAR __Result = MAXX( FILTER( __Table, [__Count] = __Max ), [Answer] ) RETURN __Result
sharmisaranga09
Helper I
2 years agoThe count/frequency column i mentioned earlier was an output from a measure
- Greg_Deckler2 years ago
Community Champion
sharmisaranga09 The measure form is:
Max count Answered (measure) = VAR __Question = MAX( [Question] ) VAR __Table = SUMMARIZE( FILTER( ALL( 'Table' ), [Question] = __Question ), [Answer], "__Count", COUNTROWS( 'Table' ) ) VAR __Max = MAXX( __Table, [__Count] ) VAR __Result = MAXX( FILTER( __Table, [__Count] = __Max ), [Answer] ) RETURN __Result