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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Measure Value for Previous Month

I have a measure that I want to pull the previous months value instead of the current value when I put it in a table. Is it possbile to do this and ignore all page date filters as well? Needed in a calculation so I cant just filter the visual either.

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You must have a Calendar Table with calculated columns for Year, Month name and Month number.  Sort the Month name by the Month number.  Create a relationship from the Date column of your Data Table to the Date column of the Calendar Table.  Create slicers from the year and Month name columns of the Calendar Table and select a year and Month name.  Write these measures

Total = sum(Data[Amount])

Previous month total = calculate([Total],previousmonth(Calendar[Date]))

Hope this helps.


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

View solution in original post

2 REPLIES 2
nicoenz
Helper II
Helper II

You made my day with this!!!! the date table is what did the trick

Ashish_Mathur
Super User
Super User

Hi,

You must have a Calendar Table with calculated columns for Year, Month name and Month number.  Sort the Month name by the Month number.  Create a relationship from the Date column of your Data Table to the Date column of the Calendar Table.  Create slicers from the year and Month name columns of the Calendar Table and select a year and Month name.  Write these measures

Total = sum(Data[Amount])

Previous month total = calculate([Total],previousmonth(Calendar[Date]))

Hope this helps.


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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.