Forum Discussion

villa1980's avatar
villa1980
Resolver II
1 year ago

Incorrect Rank on %

Hi all,

 

 I have a Field [METRICS] which calculates a percentage from another field [CONT] (Contains Sales, MArgin, Budget by POS Name) which is joined to field [CSD] that contains POS Names (Eg. Centre1, Centre2).

 There are other fields which contain different data and [METRICS] field creates calculations from those.

The % Calc in the metric is MtTrgt_% = sum(CONT[Margin]) / sum(CONT[Margin Budget])
What I would like to do is rank this %, however, when I rank on this metric it just shows 1 not a full rank, what I am doing wrong?

Rank Calc = RANK(DENSE,ALLSELECTED('CSD'[POS Name]), ORDERBY (MtTrgt_%],desc) )

 

Many Thanks


Alex

4 Replies

    • villa1980's avatar
      villa1980
      Resolver II

      My apologies that seems to work brilliantly thank-you, I have another issue now, if I bring in POS No into the table the Ranking reverts back to one.
      How do I overcome this issue?

      Thanks

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi villa1980 ,

         

        Try below expression:

        Measure = var _t = ADDCOLUMNS('CSD',"RANK",RANKX(FILTER(ALL('CSD'),[POS NAME]=EARLIER([POS NAME])),[MtTrgt_%],,DESC,Dense))
        RETURN MAXX(_t,[Rank])

         

        Hope it helps!

         

        Best regards,
        Community Support Team_ Scott Chang

         

        If this post helps then please consider Accept it as the solution to help the other members find it more quickly.