March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
70 | |
55 | |
44 |
User | Count |
---|---|
207 | |
108 | |
106 | |
66 | |
60 |