Forum Discussion
Ranking a measure
- 7 years ago
Hi Anonymous,
Based your sample, you could have a try with the measure below.
SumPointsRank = Var summry=SUMMARIZE(ALLSELECTED(Results),[Player],"Sum",SUM(Results[Points])) var tmp=ADDCOLUMNS(summry,"RNK",RANKX(summry,[Sum],,DESC,Dense)) return MAXX(FILTER(tmp,[Player]=SELECTEDVALUE(Results[Player])),[RNK])
If you don't want to create a temp table, you also could use the measure2.
Measure2=
RANKX(ALLSELECTED(Results),CALCULATE(SUM(Results[Points]),ALLEXCEPT(Results,Results[Player])),,DESC,Dense)Here is the output result.
More details, you could refer to the attachment.
Best Regards,
Cherry
Thanks for your response - I've had a look at your file and can't see any difference between yours and mine, yet my ranking isn't working. I also tried Greg's suggestion buy it didn't yield the required results.
Here's my file (containing dumy data):
The visualisation is on the 3rd tab.
Hi Anonymous,
Based your sample, you could have a try with the measure below.
SumPointsRank = Var summry=SUMMARIZE(ALLSELECTED(Results),[Player],"Sum",SUM(Results[Points])) var tmp=ADDCOLUMNS(summry,"RNK",RANKX(summry,[Sum],,DESC,Dense)) return MAXX(FILTER(tmp,[Player]=SELECTEDVALUE(Results[Player])),[RNK])
If you don't want to create a temp table, you also could use the measure2.
Measure2=
RANKX(ALLSELECTED(Results),CALCULATE(SUM(Results[Points]),ALLEXCEPT(Results,Results[Player])),,DESC,Dense)
Here is the output result.
More details, you could refer to the attachment.
Best Regards,
Cherry
- Anonymous7 years agoNot applicable
Thansk Cherry - I made a minor tweak to include the Year-Month in the ALLEXCEPT function (as once the real data was included the output wasn't correct) - and it has worked. Thank you.
Final measure:
Measure2 = RANKX(ALLSELECTED(Results),CALCULATE(SUM(Results[Points]),ALLEXCEPT(Results,Results[Player],Results[Year-Month])),,DESC,Dense)
- aizamkamadin7 years agoHelper II
why when im using measure2, its give a different result(wrong result) compare to using temp table.
but if im using temp table.. i cant see the rank over the time.. because it give the same result.
pls help
- SharonHMA6 years agoHelper I
Hi v-piga-msft
If I want to rank data for individuals each and every month in a visual how would I adjust your formula. I tried:
Rank TLeads Owner = RANKX(ALLSELECTED(Merged),CALCULATE(SUM(Merged[Count Leads]),ALLEXCEPT(Merged,Merged[Lead Owner],'Calendar'[Month Year])),,DESC,Dense)
However I'm getting totally wrong results.
Also, I have the visual filtered for only certain team members so I want the rankings for them alone
Effectively I want to sore each month in a clustered column chart from highest to lowest based on the legend.
Thanks, Sharon
- Anonymous4 years agoNot applicable
Thanks for this solution. I had a similar requirement and it worked like a charm.
However, I have a category of Players as well, say A, B and C and I want to rank the Players within these categories. Wondering what change should I do in the below temp table measure to get the desired result.
Thanks in advance!!
SumPointsRank = Var summry=SUMMARIZE(ALLSELECTED(Results),[Player],"Sum",SUM(Results[Points])) var tmp=ADDCOLUMNS(summry,"RNK",RANKX(summry,[Sum],,DESC,Dense)) return MAXX(FILTER(tmp,[Player]=SELECTEDVALUE(Results[Player])),[RNK])