cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Previou's month's rank based on my current month measure

HI,

I have the following dax measure that ranks games based on sum of sales.

How can I get the previous month's rank. 

My goal is to show whether a game has gone up/down in rank. Here's my measure for current month

 

Rank ALL SELECTED = 
RANKX( 
    ALLSELECTED( 'Table'),
    CALCULATE(
        SUM('Table'[Revenue])),
    , DESC, Dense 
    )
    

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Previou's month's rank based on my current month measure

@RogerSteinberg As a best practice, add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.

https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-ca...

 

and from date dimension add a measure for previous month rank

 

Rank Previous Month = 
CALCULATE ( [Rank Measure], DATEADD ( DateTable[Date], -1, MONTH )

OR

Rank Previous Month = 
CALCULATE ( [Rank Measure], PREVIOUSMONTH ( DateTable[Date] )

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

1 REPLY 1
Highlighted
Super User IV
Super User IV

Re: Previou's month's rank based on my current month measure

@RogerSteinberg As a best practice, add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.

https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-ca...

 

and from date dimension add a measure for previous month rank

 

Rank Previous Month = 
CALCULATE ( [Rank Measure], DATEADD ( DateTable[Date], -1, MONTH )

OR

Rank Previous Month = 
CALCULATE ( [Rank Measure], PREVIOUSMONTH ( DateTable[Date] )

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors