Forum Discussion

SLI's avatar
SLI
Helper IV
6 years ago
Solved

Product's Rank

hi 

 

i have 3 dimension's tables (dim_time, dim_product and dim_pointofsale) and 1 fact table (fact_production) in wich i have sales by product, date and point of sale

i have calculated THSalesp M-1 = calculate (sum (fact_production [sales]), previousmonth (dim_time [date]))

 

i would like to have the position (rank)of my product compared to Sales previous month per date and point of sale

 

is it possible with dax

i have used this formula but the result is not correct

Rank =
RANKX (
ALL( FACT_Production[ReferenceProduit]),calculate([THSalesp M-1],ALLEXCEPT(FACT_Production,FACT_Production[ReferenceProduit],FACT_Production[POS],FACT_Production[Date])),,DESC,Dense)

 

Here i share with you my sample of model

 

thank you in advance for your help

SLI

 

 

5 Replies