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
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.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
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
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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.