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.
I am trying to create an S-Curve from our MS Project task data using the following DAX code
Solved! Go to Solution.
Hi,
I think the culprit is your AND-operator, it should be && instead of &
you could write your code like this
Cumulative Actuals = CALCULATE ( SUM ( 'Tasks'[ActualCost] ), FILTER ( ALL ( 'Tasks' ), NOT ( ISBLANK ( 'Tasks'[ActualCost] ) ) && 'Tasks'[TaskFinishDate] <= MAX ( 'Tasks'[TaskFinishDate] ) ) )
Cheers,
Sturla
Try this
Cumulative Actuals = CALCULATE ( SUM ( 'Tasks'[ActualCost] ), FILTER ( ALLEXCEPT ('Tasks','Tasks'[Project ), NOT ( ISBLANK ( 'Tasks'[ActualCost] ) ) && 'Tasks'[TaskFinishDate] <= MAX ( 'Tasks'[TaskFinishDate] ) ) )
If you have other filters you want to keep, they need to be added to the ALLEXCEPT-function
cheers,
Sturla
Hi,
I think the culprit is your AND-operator, it should be && instead of &
you could write your code like this
Cumulative Actuals = CALCULATE ( SUM ( 'Tasks'[ActualCost] ), FILTER ( ALL ( 'Tasks' ), NOT ( ISBLANK ( 'Tasks'[ActualCost] ) ) && 'Tasks'[TaskFinishDate] <= MAX ( 'Tasks'[TaskFinishDate] ) ) )
Cheers,
Sturla
@sturlaws
Thanks for the solution, works as requested, unfortunately my request wasn't quite correct as it shows the Actuals for all projects, rather than the one(s) I have filtered (via slicer) or in the Filters.
What should I add to achieve something other that a >£30m horizontal line ?
Cheers
Fred
Try this
Cumulative Actuals = CALCULATE ( SUM ( 'Tasks'[ActualCost] ), FILTER ( ALLEXCEPT ('Tasks','Tasks'[Project ), NOT ( ISBLANK ( 'Tasks'[ActualCost] ) ) && 'Tasks'[TaskFinishDate] <= MAX ( 'Tasks'[TaskFinishDate] ) ) )
If you have other filters you want to keep, they need to be added to the ALLEXCEPT-function
cheers,
Sturla
Thanks Sturla, that did the trick . . . . well, sort of in that it gave me the overall total for the selected project. The requirement I've got is that management want to see how the costs are progressing, creating a Cumulative/S-Curve report. What I'm getting is a flat-line showing the overall total all the way across. The data I have is a month by month spend and, in Excel, I can generate a graph that shows how the overall spend is increasing each month, using a formula to increment the overall cost. as below
However, in Power BI, using the DAX code you've helpfully provided to get the cumulative total, but otherwise the same data I end up with a flat line at £7,121.35
Apologies if I've missed something critical, the date is not heirarchical and the Cumulative SAP Actuals is from the DAX code. What am I doing wrong ?
I am not able to recreate your issue, so pardon me if I now ask a lot of stupid questions in order to identify the problem. Is it possible that you have created a calculated column instead of a measure?
No, definitely a Measure
Hi Sturla, my bad, I just checked and realised I'd put a .[Date] suffix in the final statement. With that removed it gave me the "curve" I was looking for, now all I need do is stop it looking "blocky" and more "curved"
Thanks so much for your help in this
Regards
Fred
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 |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |