Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
118 | |
101 | |
71 | |
61 |