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
BradyVan
New Member

Using DAX Calculate in a column to get a column based running total

Hello,

 

I am trying to create a column that will show much a running total as of a given date. I have the function working as you can see below where it is showing me the running total sum of everything that meets the all except filter. However, I am struggling to find a way to filter the sum to only rows with a month value equal to or less than the date in the current row.

 

I.E the results by row should be

Row 1 = 7680

Row 2 = (7680 +2720) = 10,400
Row 3 = (7680 + 2720 - 3964) =  6,436

Etc.


Screenshot 2025-01-04 232944.png

 

Thank you!

1 ACCEPTED SOLUTION
BradyVan
New Member

2 REPLIES 2
suparnababu8
Super User
Super User

Hi @BradyVan 

Please use the below DAX measure to get desired output. 

RunningTotal = 
CALCULATE(
    SUM(OnHandHistory[QuantityMoved]),
    FILTER(
        ALLEXCEPT(OnHandHistory, OnHandHistory[Item_No], OnHandHistory[Location_Code]),
        OnHandHistory[Month] <= EARLIER(OnHandHistory[Month])
    )
)

 

I implemented the same in my PBI desktop and am getting correct results as per your requirement.

 

suparnababu8_0-1736063433572.png

Unfortunately, I don't have access to add pbix file here. Just implement the above DAX code. Please let me know if it works.

Thank you!

Regards

Suparna Babu

BradyVan
New Member

I was able to solve this 

https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Change-DAX-calculated-column-using-E...

Using this other thread. Unsure how to mark as solved.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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