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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
crobson29
Helper I
Helper I

Last month cumulative measure not working

I am trying to create a line chart that shows cumulative sales for both the month selected by a slicer and the previous month.  I have built a measure for cumulative sales for the current month that works correctly, the measure is:

 

Current Month = TOTALMTD(SUM(VW_FACT_SALES_DOCUMENT_ITEM_DATA_USA[Weight (Gallons)]), 'M_CALENDAR_BILLING'[Date])
 
The prior month is what is giving me trouble.  I have this measure built:
 
Prior Month = TOTALMTD(SUM(VW_FACT_SALES_DOCUMENT_ITEM_DATA_USA[Weight (Gallons)]), PARALLELPERIOD('M_CALENDAR_BILLING'[Date], -1, MONTH))
 
But this only gives me the total for the whole month.  This is what the chart currently looks like:
crobson29_0-1709133485371.png

How can I get the prior month measure to give me a cumulative sum for each day, like the current month measure?

 
1 ACCEPTED SOLUTION
v-jingzhan-msft
Community Support
Community Support

Hi @crobson29 

 

You can use this measure for previous month

Previous Month = CALCULATE(SUM(VW_FACT_SALES_DOCUMENT_ITEM_DATA_USA[Weight (Gallons)]),DATEADD(DATESMTD('M_CALENDAR_BILLING'[Date]),-1,MONTH))

vjingzhanmsft_0-1709192865615.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

2 REPLIES 2
crobson29
Helper I
Helper I

This is exactly what I was going for, Thank you!

v-jingzhan-msft
Community Support
Community Support

Hi @crobson29 

 

You can use this measure for previous month

Previous Month = CALCULATE(SUM(VW_FACT_SALES_DOCUMENT_ITEM_DATA_USA[Weight (Gallons)]),DATEADD(DATESMTD('M_CALENDAR_BILLING'[Date]),-1,MONTH))

vjingzhanmsft_0-1709192865615.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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