Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

How to apply a PREVIOUSMONTH measure to a standard date filter?

Hi guys, I currently have a report page that is filtered by a date column in a date table. This is currently on a slicer tool with a single select for year, month, as shown below: 

KyleAdam_0-1645915088708.png

 

And when that month is selected, all finances on that page are selected for that specific month. However, I want to make it so that it shows all finances for the previous month instead. So when I select October 2021, really it shows me the finances for September 2021. 

I know there is a DAX function called PREVIOUSMONTH:

FinanceMonth = PREVIOUSMONTH('Date'[Date].[Month]) 



But I'm not sure how to apply it in this context. I've tried creating the PREVIOUSMONTH with this current date column and date table but it won't allow me to add it to the slicer. Is there any suggestions or help on how I've went wrong and how to rectify this problem? 

 

 

 

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

It will work like this

=calculate([Totalsales],previousmonth(calendar[date]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
jianlong
Resolver I
Resolver I

Here is a sreenshot for your reference:
1) create a table with current month and previous month.   "Previousmonth" can be used to create Prev column,

2) create relationship between the date/month in your finance table, and "Prev" month..

 

Hope this help. 

jianlong_0-1645923476099.png

 

Ashish_Mathur
Super User
Super User

Hi,

It will work like this

=calculate([Totalsales],previousmonth(calendar[date]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Ashish_Mathur thank you, it does involve creating a of measures this way because I have several finance data that is being displayed, but it still works so thank you. 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors