Forum Discussion
DAX comparison operations do not support comparing values of type Text with values of type Date.
I am trying to create an S-Curve from our MS Project task data using the following DAX code
Hi,
I think the culprit is your AND-operator, it should be && instead of &
you could write your code like thisCumulative Actuals = CALCULATE ( SUM ( 'Tasks'[ActualCost] ), FILTER ( ALL ( 'Tasks' ), NOT ( ISBLANK ( 'Tasks'[ActualCost] ) ) && 'Tasks'[TaskFinishDate] <= MAX ( 'Tasks'[TaskFinishDate] ) ) )Cheers,
SturlaTry 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
7 Replies
- sturlaws
Resident Rockstar
Hi,
I think the culprit is your AND-operator, it should be && instead of &
you could write your code like thisCumulative Actuals = CALCULATE ( SUM ( 'Tasks'[ActualCost] ), FILTER ( ALL ( 'Tasks' ), NOT ( ISBLANK ( 'Tasks'[ActualCost] ) ) && 'Tasks'[TaskFinishDate] <= MAX ( 'Tasks'[TaskFinishDate] ) ) )Cheers,
Sturla- AnonymousNot applicable
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
- sturlaws
Resident Rockstar
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