Forum Discussion

kusanagi's avatar
kusanagi
Frequent Visitor
3 years ago
Solved

Ranking with matrix

Hi There, I need help with the ranking. I tried to search similar issues, but still stuck at this formula.   This is my current formula and the output: Rank = IF(HASONEVALUE(Sheet1[Item]),RANKX(...
  • v-yueyunzh-msft's avatar
    3 years ago

    Hi , kusanagi 

    According to your dax code, normally it can work in my understand .

    I use your dax code in my side , it works good , and this is my test data:

    When i use this dax code :

    Measure 2 = RANKX(ALLSELECTED('Table'[Item]) , [Qty] , ,DESC,Dense)

    So i think it may cause by the other reason in your side.

     

    You can try to use this dax code :

    Measure = IF( HASONEVALUE('Table'[Item]) , RANKX(SELECTCOLUMNS(CALCULATETABLE( 'Table'  , ALLSELECTED('Table'[Item])  ),"Item",[Item])  , [Qty] ,,DESC,Dense))

     

    If you still can not solve this problem , can you share the sample .pbix file to me (without sensitive data in it) so that i can test it in my side.

     

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

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