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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
thampton
Helper III
Helper III

Dynamic running total

I would like to create a running total based on different parameters (YTD, Last year (starting at 1/1-12/31),Trailing 12 mo,etc).

 

I have a table that has Date in column 1, total in column 2. 

 

I have the DAX below caculating a running total, how would i configure it to match the parameters above? 

 

Running total =
CALCULATE (
       SUM ( Total Column ),
       ALL (Table Name),
       Date Column<= EARLIER (Date Column)
)
1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

currently you have to create a measure for each "time calculation". A good starting point is to create a separate Calendar table and to read through these examples: https://www.daxpatterns.com/time-patterns/

 

In the future this will become much simpler, as you can read here:

https://blogs.msdn.microsoft.com/analysisservices/2019/03/01/whats-new-for-sql-server-2019-analysis-...

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey,

 

currently you have to create a measure for each "time calculation". A good starting point is to create a separate Calendar table and to read through these examples: https://www.daxpatterns.com/time-patterns/

 

In the future this will become much simpler, as you can read here:

https://blogs.msdn.microsoft.com/analysisservices/2019/03/01/whats-new-for-sql-server-2019-analysis-...

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
PattemManohar
Community Champion
Community Champion

@thampton  Based on the information that you have provided, please try this..

 

RunningTotal = CALCULATE(SUM(TotalColumn),
			 FILTER(ALL(TableName),DateColumn <= EARLIER(DateColumn))
			)

It will be always helpful if you can post some sample data and expected output.





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

Proud to be a PBI Community Champion




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.