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.
Morning,
I'm really struggling with creating a Cumulative total and not sure what I'm doing wrong. I've managed to create it previously but I couldn't get it to limit the values to this financial year (it was working the whole table) so I created a new table in DAX just bringing in the date periods I needed but now I can't get the running total to work.
Here's the code I'm using
Date | Budget | Projection |
01-Feb-21 | 194.37 | 296.97 |
01-Feb-21 | 146.28 | 98.05 |
01-Feb-21 | 707.19 | 96.36 |
01-Feb-21 | 3683.07 | 1712.34 |
01-Feb-21 | 2034.12 | 2564.96 |
01-Mar-21 | 110.37 | 244.53 |
01-Mar-21 | 34327.02 | 11786.25 |
01-Mar-21 | 15110.45 | 5989.95 |
01-Mar-21 | 14410.2 | 24919.87 |
01-Mar-21 | 1223.43 | 1370.46 |
Solved! Go to Solution.
Hi, @Anonymous
You can change the above measure like this:
Cumulative Sum =
var _max = maxx(allselected(Cummlative),Cummlative[Date])
return
CALCULATE (
sum(Sheet1[Budget]),
FILTER (
ALLselected ( Sheet1),
Sheet1[Date] <= MAX (Sheet1[Date] )
&& Sheet1[Date] <=_max
)
)
And you can get what you want, like this:
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Try a measure like
Cumulative Sum =
var _max = maxx(allselected(sheet,sheet[Date]))
return
if( CALCULATE (
sum(Sheet1[Budget]),
FILTER (
ALLselected ( Sheet1),
Sheet1[Date] <= MAX (Sheet1[Date] )
&& Sheet1[Date] <=_max
)
)
Thanks for the quick reply on this,
the MaxX is missing an expression - any ideas?
Thanks.
Hi, @Anonymous
You can change the above measure like this:
Cumulative Sum =
var _max = maxx(allselected(Cummlative),Cummlative[Date])
return
CALCULATE (
sum(Sheet1[Budget]),
FILTER (
ALLselected ( Sheet1),
Sheet1[Date] <= MAX (Sheet1[Date] )
&& Sheet1[Date] <=_max
)
)
And you can get what you want, like this:
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
105 | |
78 | |
68 | |
63 |
User | Count |
---|---|
148 | |
107 | |
106 | |
84 | |
70 |