Forum Discussion

VFTrm99's avatar
VFTrm99
Frequent Visitor
6 years ago
Solved

To use do ranking with multiple criterias

Dear Experts,

 

 

I'm quite new in DAX and would like to add new column with ranking from "Revenue" by "Material" in which the ranking itself will be changed based on "BillingDate" slicer.

 

I was googling and find fuction "RANKX" would fulfill me needs but it seems the result is not correct.

 

Please help me to advise what should I do in order to get the expected result.

 

Sample file.

https://www.dropbox.com/s/ikqe9pshzxp252j/Sample.pbix?dl=0 

 

3 Replies

  • mhossain's avatar
    mhossain
    Icon for Solution Sage rankSolution Sage

    VFTrm99 Try with 'ALLSELECTED'

     

    RankX = RANKX(
    ALLSELECTED(Sheet1),
    Sheet(Revenue),
    ,DESC)

     

     

    • VFTrm99's avatar
      VFTrm99
      Frequent Visitor

      mhossain  Thank for you advice

       

      But it seems the result still incorrect.

      For example, material 2298121 has 3 different ranks 1,3 and 5

       

      I'm sorry my question might not be clear.

      The expected result I would like to see is that;

       

      One Material has only 1 rank and when I filter BillingDate in the slicer, the rank might or might not be changed based on Revenue in that particular period.

       

       

      Sample file:

      https://www.dropbox.com/s/ikqe9pshzxp252j/Sample.pbix?dl=0