Forum Discussion

keknight's avatar
keknight
Frequent Visitor
8 years ago
Solved

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:

 

SubjectInstitutionScore 1Score 2
S1I110030
S1I250080
S1I3655
S1I43231
S2I12655
S2I27566
S2I38154
S2I49623
S2I55586
S3I24471
S3I33655
S3I444538
S3I52812

 

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-msft's avatar
    v-yulgu-msft
    Microsoft 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_Seamark's avatar
    Phil_Seamark
    Microsoft 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?

    • keknight's avatar
      keknight
      Frequent 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.