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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JazZ0003
Regular Visitor

Get commulative total last year until December only

I want to get the commulative total of last year's data until december 31 only, regardless of the current month/year I selected in the charts.

 

Below is the formula I used to get the commulative total up to selected date.

 

 CALCULATE([Nominal Accounts],   FILTER(ALLSELECTED(Dates[Date]), Dates[Date] <= MAX(Dates[Date])))

 

 

4 REPLIES 4
v-xuding-msft
Community Support
Community Support

Hi  @JazZ0003 ,

 

Please try this:

lastyear = CALCULATE(SUM(financials3[Sales]),DATEADD(financials3[Date],-1,YEAR))
Running total = CALCULATE([lastyear],FILTER(ALL(financials3),financials3[Date] <= MAX(financials3[Date])))

 5.PNG

https://docs.microsoft.com/en-us/power-bi/create-reports/service-reports-visual-interactions#enable-...

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

thank you @v-xuding-msft

But most of your solutions focused on previous year only. I need to compute the running total since from the beggining of data, not only previous year.

 

This is what I want to acheive, running total from all the data from all prevous year upto last year december.

This would be the outcome.

https://drive.google.com/file/d/1ka6IgcOauj1dNck3M9rawsHewF-kHxIJ/view 

amitchandak
Super User
Super User

@JazZ0003 , something like this with date table

 

Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))

This year
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))

 

 

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 :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


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
harshnathani
Community Champion
Community Champion

Hi @JazZ0003 ,

 

Try this measure

 

Sales YTD = CALCULATE( [Nominal Accounts], DATESYTD( 'Date'[Date] ) )

 

https://www.sqlbi.com/articles/computing-running-totals-in-dax/

 

Regards,

Harsh Nathani

Appreciate with a Kudos!! (Click the Thumbs Up Button)

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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 Kudoed Authors