Forum Discussion
Anonymous
8 years agoNot applicable
Ranking a calculated measure in a table visualisation
Hello, I have the following table as a visualisation but without rank column on the right hand side. Please can you tell me how to add this if the other column is a calculated measure? I've seen ...
- 8 years ago
Note that I improved this with a non-trivial case of measure ranking, PBIX attached.
Measure Rank 1 = VAR __current = CALCULATE(MAX([Column1])) VAR __table = SUMMARIZE(ALL(Table1),[Column1],"__Measure",[Measure]) VAR __table1 = ADDCOLUMNS(__table,"__Rank",RANKX(__table,[__Measure])) RETURN MAXX(FILTER(__table1,[Column1]=__current),[__Rank])
Anonymous
8 years agoNot applicable
Thanks for trying but I'm afraid it's too complicated. I'll have to export the table into excel and just use the rank function.
Thanks,
CM
Greg_Deckler
Community Champion
8 years agoI'm not sure how a single line is overly complicated:
Measure Rank = RANKX(ALL(Table1),[Measure])
Or 2 lines for your Standard Deviation question.
Measure StdDev = VAR __table = SUMMARIZE(Table1,[Column1],"__Measure",[Measure]) RETURN STDEVX.P(__table,[__Measure])
But, perhaps it is. People have different definitions of complex.
- Greg_Deckler8 years ago
Community Champion
Note that I improved this with a non-trivial case of measure ranking, PBIX attached.
Measure Rank 1 = VAR __current = CALCULATE(MAX([Column1])) VAR __table = SUMMARIZE(ALL(Table1),[Column1],"__Measure",[Measure]) VAR __table1 = ADDCOLUMNS(__table,"__Rank",RANKX(__table,[__Measure])) RETURN MAXX(FILTER(__table1,[Column1]=__current),[__Rank])
- v-juanli-msft8 years ago
Community Support
Hi Anonymous
As tested, Greg_Deckler's solution works, does it exactly meet your goal?
If so, could you kindly mark it as a solution?
Best Regards
Maggie