Forum Discussion

maksbotan's avatar
maksbotan
New Member
3 years ago

DAX rank difference between current and previous months

I want to calculate product rank difference between current and previous months

to do so :

 

1) I calculate current month rank (this work)

Rank_CM = rankx(all('table'[product]),CALCULATE(SUM('table'[qty])))
 
2) Calculate rank for previous months. It doest work, it returns me same value as (1)
 Rank_LM = CALCULATE([Rank_CM], DATEADD('table'[period].[Date],-1,MONTH))
 
how can I fix 2?
 

1 Reply

  • olgad's avatar
    olgad
    Icon for Resident Rockstar rankResident Rockstar

    Hi, when i place your calculations, looks good

    You get 1 only there where there is no data in previous month