Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

RankX Ties break issue

Hi Every one!
I have a issue with the client data ranking in breaking ties, i tried the multiple ways for breaking ties in power bi but unfortunately it is not going correct can you please guide to this.
in rank_2020 measure 56 is repeating. Thanks in advance.


  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous 

    I think you can give a rank for transaction_details, add up rank1*10000+rank2 and build a new rank for this value.

    NEW Value = 
    VAR _RANK1 = RANKX(ALL(Data[transaction_details]),[M_NETSALESONLY],,DESC,Dense)
    VAR _RANK2 = RANKX(ALL(Data),CALCULATE(MAX(Data[transaction_details])),,ASC,Dense)
    RETURN
    _RANK1*10000+_RANK2
    New Rank = 
    RANKX(ALL(Data[transaction_details]),[NEW Value],,ASC,Dense)

    My Test:

    Best Regards,
    Rico Zhou

     

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

4 Replies

  • Anonymous , Try a measure like

     

    new sales = [M_NETSALESONLY] + rand()/1000

     

    use this in rank

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Amit but the issue is still there

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous 

        I think you can give a rank for transaction_details, add up rank1*10000+rank2 and build a new rank for this value.

        NEW Value = 
        VAR _RANK1 = RANKX(ALL(Data[transaction_details]),[M_NETSALESONLY],,DESC,Dense)
        VAR _RANK2 = RANKX(ALL(Data),CALCULATE(MAX(Data[transaction_details])),,ASC,Dense)
        RETURN
        _RANK1*10000+_RANK2
        New Rank = 
        RANKX(ALL(Data[transaction_details]),[NEW Value],,ASC,Dense)

        My Test:

        Best Regards,
        Rico Zhou

         

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous  It is working !!! Thanks for your support and effort.