Forum Discussion

dbeaton41's avatar
dbeaton41
New Member
7 years ago
Solved

Rank Multiple Measures

Hi

I've searched the forums but can't find an answer to my particular question.

I'm trying to rank one column against the values in other columns as shown below. I want the rank of the column Test_1 based on columns Test_1 to Test_5 where Test_1 to Test_5 are measures. Does anyone know if this is possible?

 

Thanks

 

YearMonthTest_1Test_2Test_3Test_4Test_5Rank_Test_1
2016March6.0983716.446276.8378735.8205976.4078694
2016April6.2007626.55366.8736626.0034216.4711364
2016May6.4313776.4651016.8479855.9080996.0822413
2016June6.0344976.5874866.9197056.2216086.4795825
  • Anonymous's avatar
    Anonymous
    7 years ago

    dbeaton41 -

    One possibility:

     

    aTest = 
    var vTest_1 = [Test_1]
    return 1 
        + IF([vTest_1]<[Test_2],1,0) 
        + IF([vTest_1]<[Test_3],1,0) 
        + IF([vTest_1]<[Test_4],1,0) 
        + IF([vTest_1]<[Test_5],1,0)

    Cheers!

    Nathan

     

     

  • dbeaton41 

     

    Another way could be

     

    Measure =
    VAR temp = { [Test_1], [Test_2], [Test_3], [Test_4], [Test_5] }
    RETURN
        COUNTROWS ( FILTER ( temp, [Test_1] <= [Value] ) )
    

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    dbeaton41 -

    One possibility:

     

    aTest = 
    var vTest_1 = [Test_1]
    return 1 
        + IF([vTest_1]<[Test_2],1,0) 
        + IF([vTest_1]<[Test_3],1,0) 
        + IF([vTest_1]<[Test_4],1,0) 
        + IF([vTest_1]<[Test_5],1,0)

    Cheers!

    Nathan

     

     

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    dbeaton41 

     

    Another way could be

     

    Measure =
    VAR temp = { [Test_1], [Test_2], [Test_3], [Test_4], [Test_5] }
    RETURN
        COUNTROWS ( FILTER ( temp, [Test_1] <= [Value] ) )
    
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi, I had a simillar issue, but I wanted the Rank for all the values i.e. Test_1 to Test_5 in the above example. how to go about.

       

      Thanks!