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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Cumulative Sum for Previous Year Sales also includes Sales of Year before

Hi,

 

I have created a visual that is showing me the cummulative budget, landing (sales for the past, forecast for the future) and the previous year sales (plus also the latest budget revision). I created the measure for the cummulative previous year sales during the last fiscal year (Jul 19 to Jun 20). Then it worked fine. Now I added the current fiscal year and a slicer to choose between the fiscal years. The calculation for last fiscal year still works fine:

 

mallot86_0-1599721412289.png

 

THe black line shows the previous year sales of fiscal year 19 (July 18 to June 19). It starts at zero and adds up the sales from FY19.

 

If I slice for the current fiscal year, though, it starts with the cummulative sales of June 19 and adds the sales of FY20:

 

mallot86_1-1599721538204.png

 

My formula for calculating the cummulative previous year sales is:

 

m.**bleep**.ActualsLTPY =
CALCULATE([m.ActualsLT],
FILTER(
ALL(Date_DIM),
SAMEPERIODLASTYEAR(Date_DIM[Date ID].[Date])
&& Date_DIM[Date ID] <= MAX(Date_DIM[Date PY])))
 
It would be massively appreciated, if anyone could tell me, how to cummulate only the previous year sales data for the fiscal year I am slicing for.
 
Many thanks
Malte

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You can use datesytd with year-end date parameter.

example

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"6/30"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"6/30"))

 

Power BI — YTD
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , You can use datesytd with year-end date parameter.

example

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"6/30"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"6/30"))

 

Power BI — YTD
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Many thanks! It does exactly what I was looking for!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.