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
thhmez7
Helper III
Helper III

DAX running (cumulative) value over time

Hi,

 

I tried the following DAX formula to calculate the cumulative quantity, but the values to remain the same in "Quantity Running". In 2nd row it should be 135 (125 + 10).

There is a relationship between Date[Date] and Salesorderdetail[requestdeliveryby].

 

daxrunningtotal.png

Thanks.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@thhmez7 

Your dax should correct if you are creating a measure. If you want a calculated column, it should be:

Columns = calculate(sum[quantity]),filter(date, [date]<=earlier[date]))

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

Assuming the Date column in the visual has been dragged from the Date Table, write these measures:

Quantity sold = sum(salesorderdetail[Quantity])

Quantity sold YTD = calculate([Quantity sold],datesytd(calendar[date),"31/12")

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@thhmez7 

Your dax should correct if you are creating a measure. If you want a calculated column, it should be:

Columns = calculate(sum[quantity]),filter(date, [date]<=earlier[date]))

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Try this 

 

Quntity Running : =

VAR MaxDate = MAX ( 'Date'[Date] ) -- Saves the last visible date
RETURN
CALCULATE (
[Quantity], -- Computes sales amount
'Date'[Date] <= MaxDate, -- Where date is before the last visible date
ALL ( Date ) -- Removes any other filters from Date
)

 

Still same result:

daxrunningtotal2.png

Anonymous
Not applicable

Parihar26_0-1632842943289.png

I think you doing something wrong- check again 

Anonymous
Not applicable

send me your file if possible

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