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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
V-pazhen-msft
Community Support
Community Support

@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/
V-pazhen-msft
Community Support
Community Support

@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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.