Forum Discussion
Yet another ranking question
I have a large table of data, separated by subject areas (100 rows per subject). The data has been scored by subject according to two scoring methods. Here's a very abbreviated sample:
| Subject | Institution | Score 1 | Score 2 |
| S1 | I1 | 100 | 30 |
| S1 | I2 | 500 | 80 |
| S1 | I3 | 6 | 55 |
| S1 | I4 | 32 | 31 |
| S2 | I1 | 26 | 55 |
| S2 | I2 | 75 | 66 |
| S2 | I3 | 81 | 54 |
| S2 | I4 | 96 | 23 |
| S2 | I5 | 55 | 86 |
| S3 | I2 | 44 | 71 |
| S3 | I3 | 36 | 55 |
| S3 | I4 | 445 | 38 |
| S3 | I5 | 28 | 12 |
I'm trying to create a graph that will allow me to display this data by "Top N" institution. BUT, I want to show "Top N" rankings according to both ranking systems simultaneously *in the same graph*, so that if an institution is ranked highly according to one score but not another, it still shows up in the graph.
Using the above example, if I showed the top 2 institutions according to Score 1, I'd like to simultaneously see the top 2 institutions according to Score 2 in the same graph, even if one institution didn't rank in the top 2 for both Scores.
Is there a visualization that will allow me to do this?
Hi keknight,
Please create below measures:
Sum1 = SUM(Institution[Score 1]) Sum2 = SUM(Institution[Score 2]) Ranking1 = RANKX(ALL(Institution),[Sum1],,DESC,Dense) Ranking2 = RANKX(ALL(Institution),[Sum2],,DESC,Dense) Top2 = IF([Ranking1] <=2 || [Ranking2] <=2,1,0)
Add measure [Top2] into visual level filter, set its value to 1.
Best regards,
Yuliana Gu
3 Replies
- v-yulgu-msftMicrosoft Employee
Hi keknight,
Please create below measures:
Sum1 = SUM(Institution[Score 1]) Sum2 = SUM(Institution[Score 2]) Ranking1 = RANKX(ALL(Institution),[Sum1],,DESC,Dense) Ranking2 = RANKX(ALL(Institution),[Sum2],,DESC,Dense) Top2 = IF([Ranking1] <=2 || [Ranking2] <=2,1,0)
Add measure [Top2] into visual level filter, set its value to 1.
Best regards,
Yuliana Gu
- Phil_SeamarkMicrosoft Employee
There could be a visualisation that helps but can you please provide more detail on your example.
Such as what your expected output might look like in data form?
- keknightFrequent Visitor
Sure! I'm able to do exactly what I want using Pandas (Python). See above example, where some datapoints have both scores plotted, and some only have one.