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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
JakeWestonD3
Frequent Visitor

Cumulative (running) Total with specific date range

Hello community,

My company uses irregular fiscal years. They never start or end on the same day each year and they are not always the same amount of days. I want to do cumulative (running) totals that start over each fiscal year. The purpose of this would be a line chart that has the running total for each year (including the YTD running total). I have accomplished this using the "DATESYTD" Function but, as previously mentioned, the fiscal years are inconsistent so the yearly (and monthly) totals are wrong:

1.01 - Cumulative Program Awards - $ - Year-to-Year =
CALCULATE (SUM(Program_Awards_PBI[Program Award $]),
DATESYTD( 'Program_Awards_PBI'[Week Date] ))



running total but incorrectrunning total but incorrect

 
The fiscal years for the company are:

Fiscal YearStart Date - Fiscal YearEnd Date - Fiscal Year
201712/31/2016 12/29/2017
201812/30/2017 12/28/2018
201912/29/2018 12/27/2019
202012/28/2019 01/01/2021
20211/2/2021 12/31/2021


Looking at fiscal year 2017, you can see that because that fiscal year starts in 2016, the running total is not including the $133,734.44 which is throwing of the total.

 

My question, how can i do a running total that is between to specific dates? (i.e.: Start date = 12/31/2016, End Date = 12/29/2017). Using the Max function wont work because i dont want to go to the end of the range in my date table.

p.s. the fiscal months are irrgular as well. I have a date table with a consistent (day-to-day) column. In that date table i also have my fiscal years and fiscal months plotted out.

 

Thank you!

 

 

5 REPLIES 5
v-kelly-msft
Community Support
Community Support

Hi @JakeWestonD3 ,

 

Is your issue solved now?

 

Best Regards,
Kelly

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

Hey @v-kelly-msft I do have my date table set up and identified as a date table. The meausre from your post works for the cumulative total calculation and I can make other measures that isolate the years for comparison. The problem is that i need the cumulatives to start over each fiscal year. The "DATESYTD" accomplishes this but it does not start the cumulatives over based on my fiscal years, it does it based on the actual change of the year (December 31st).

Hi @JakeWestonD3 ,

 

Could you pls provide some sample data with expected output for test?

 

Best Regards,
Kelly

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

v-kelly-msft
Community Support
Community Support

Hi  @JakeWestonD3 ,

 

You need first to create a date table then checking the method in below thread:

https://community.powerbi.com/t5/Desktop/Cumulative-sum-by-month-and-fiscal-year/m-p/556953

 

 

Best Regards,
Kelly

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

amitchandak
Super User
Super User

@JakeWestonD3 , Create a date tbale and update these start and end date in that table

 

New columns in date table

Year Start = maxx(filter(FY, Date[Date] >= FY[Start Date] && Date[Date] <= FY[End Date]),FY[Start Date])

 

Year End = maxx(filter(FY, Date[Date] >= FY[Start Date] && Date[Date] <= FY[End Date]),FY[End Date])

 

FY Year = maxx(filter(FY, Date[Date] >= FY[Start Date] && Date[Date] <= FY[End Date]),FY[Fiscal Year])

 

Year Rank = RANKX(all('Date'),'Date'[Year Start],,ASC,Dense)

 

Day of Year =datediff([Year Start] , [Date],Day) +1

 

 

With above columns try new measures for YTD

 

YTD= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank]) && 'Date'[Day of Year] <= Max('Date'[Day of Year]) ))
LYTD = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])-1 && 'Date'[Day of Year] <= Max('Date'[Day of Year])))

 

or

 

YTD= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year]) && 'Date'[Day of Year] <= Max('Date'[Day of Year]) ))
LYTD = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year])-1 && 'Date'[Day of Year] <= Max('Date'[Day of Year])))

 

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors