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
ronaldbalza2023
Continued Contributor
Continued Contributor

Running Balance DAX Formula

Hello everyone,

I hope you're doing well. I have a question regarding creating a running balance DAX formula using a specific data table.

 

I'm working with a data table that includes columns for Date, Transaction Type (debit or credit), and Amount. My goal is to calculate a running balance based on these transactions. Essentially, I want to derive a cumulative balance that updates with each new transaction, adjusting based on whether it's a debit or credit.

 

ronaldbalza2023_0-1719375562724.png

Thank you in advance for any help you can provide.

 

2 ACCEPTED SOLUTIONS
danextian
Super User
Super User

Hi @ronaldbalza2023 

Create a dates table, relate that to your fact table and create this sample measure.

Cumulative Total Revenue = 
CALCULATE (
    [Total Revenue],
    FILTER ( ALL ( Dates ), Dates[Date] <= MAX ( Dates[Date] ) )
)

danextian_0-1719379987653.png

Please see attached pbix for details.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

danextian
Super User
Super User

hi @ronaldbalza2023 ,

 

Did you use a separate dates table as suggested? On top of that, you must use the date column from that dates table as the filter modifier ,  ALL (  Dates ), is applied to that table.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

hi @ronaldbalza2023 ,

 

Did you use a separate dates table as suggested? On top of that, you must use the date column from that dates table as the filter modifier ,  ALL (  Dates ), is applied to that table.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
danextian
Super User
Super User

Hi @ronaldbalza2023 

Create a dates table, relate that to your fact table and create this sample measure.

Cumulative Total Revenue = 
CALCULATE (
    [Total Revenue],
    FILTER ( ALL ( Dates ), Dates[Date] <= MAX ( Dates[Date] ) )
)

danextian_0-1719379987653.png

Please see attached pbix for details.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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.