Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

RankX help

I've tried a number of solutions reading through these forums and have learned quite a bit. But I'm still struggling with this particular Ranking. Here is a sample of what my data looks like.

 

sup_namCount of ReasonMonth Name 3
Manager 116January
Manager 112February
Manager 211January
Manager 221February
Manager 3 20January
Manager 3 15February

 

When I apply the rank using a filter for one month I get the rank I'm looking for.

 

Filtered JanCount of ReasonRank
Manager 212January1
Manager 116January2
Manager 320January3

 

However when I have multiple months selected I get where each Manager is ranked for each month instead of being ranked by the total reasons.

 

Filtered Jan & FebCount fo ReasonRank
Manager 211January1
Manager 112February2
Manager 315February3
Manager 116January4
Manager 320January5
Manager 221February6

 

Here is my measure; 

 

RankingMeasure =
IF (
    ISFILTERED ( 'Manager Totals By Month'[Month Name 3] ),
    RANKX (
            ALLSELECTED ( 'Manager Totals By Month' ),
            CALCULATE ( SUM ( 'Manager Totals By Month'[CountofReason] ) ),
            ,
            asc
     ),
    RANKX (
            ALL ( 'Manager Totals By Month' ),
            CALCULATE ( SUM ( 'Manager Totals By Month'[CountofReason] ) ),
            ,
            asc
    )
)
 
 
 
Thanks for all the previous help and the help on this.
  • Anonymous's avatar
    Anonymous
    7 years ago

    How about this:

    RANKX = 
    IF ( 
        HASONEVALUE( 'RankX Help'[sup_nam]),
        RANKX( 
            ALL('RankX Help'[sup_nam]), 
            [Total Count of Reason],,ASC,Dense
        )
    )

    Looks like it produces what you are after:

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I forgot to add what I'm looking for. I'm looking for the ranking on all the totals for each manager for the selected months. Such as Jan & Feb selected;

     

    Manager 128N/A1
    Manager 232N/A2
    Manager 335N/A3
    • Anonymous's avatar
      Anonymous
      Not applicable

      How about this:

      RANKX = 
      IF ( 
          HASONEVALUE( 'RankX Help'[sup_nam]),
          RANKX( 
              ALL('RankX Help'[sup_nam]), 
              [Total Count of Reason],,ASC,Dense
          )
      )

      Looks like it produces what you are after:

      • Anonymous's avatar
        Anonymous
        Not applicable

        In your example is [Total count of Reason] a new measure? I'm having trouble replicating your formula, when I try to type in that particular field does not pop up.

         

        Eample1