Forum Discussion
Zerozinho
5 years agoNew Member
How do I rank inside many segments?
Hey, I'm not experienced with PowerBI and I'm failing to rank the following data: Name Group Segment Value Rank Max Rank Jorge 1 Small 9 1 1 Jorge 1 Medium 9 1 2 G...
- Anonymous5 years ago
Hi Zerozinho ,
You can use this DAX expression to Rank groups and segments.
Ranki = RANKX(FILTER(ALL('Table'),'Table'[Segment] = MAX ('Table'[Segment]) && 'Table'[Group] = MAX ('Table'[Group])),CALCULATE(Sum('Table'[Value])))For MAX Rank you can use the following DAX
Counti = COUNTX(FILTER(ALL('Table'),'Table'[Segment] = MAX ('Table'[Segment]) && 'Table'[Group] = MAX ('Table'[Group])),CALCULATE(Sum('Table'[Value])))Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Anonymous
5 years agoNot applicable
Hi Zerozinho ,
You can use this DAX expression to Rank groups and segments.
Ranki = RANKX(FILTER(ALL('Table'),'Table'[Segment] = MAX ('Table'[Segment]) && 'Table'[Group] = MAX ('Table'[Group])),CALCULATE(Sum('Table'[Value])))
For MAX Rank you can use the following DAX
Counti = COUNTX(FILTER(ALL('Table'),'Table'[Segment] = MAX ('Table'[Segment]) && 'Table'[Group] = MAX ('Table'[Group])),CALCULATE(Sum('Table'[Value])))
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Zerozinho
5 years agoNew Member
Thank you very much! It worked just fine!
Another question, do you have any idea of how to do the column "Max Rank", that just collect the number of rows in each "peer group" and set it as the Max Rank column in my example?