Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

DAX RANK - At different Hierarchy

I have three tables as shown below. I need to find the rank at store,product level based on units sold.Also,in the view I need another rank column whcih displays rank of the product at city,product,R...
  • v-frfei-msft's avatar
    7 years ago

    Hi Anonymous ,

     

    Here I create the relationship between tables as below.

     

     

    Then I create three measures.

     

    Measure = CALCULATE(SUM(Factsales[salesunit]))
    ranklocation = IF(ISBLANK([Measure]),BLANK(),RANKX(ALL(Location),[Measure],,DESC,Dense))
    rankproduct = IF(ISBLANK([Measure]),BLANK(),RANKX(ALL('Product'),[Measure],,DESC,Dense))

     

     

    Regards,

    Frank