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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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