Forum Discussion
PC2022
Helper III
1 year agoCalculating on/off schedule
Below is my DAX to calculate schedule status - on schedule, off schedule, on watch (if the due date is within 45 day from today). DAX works but not completely. The third task on the screenshot below ...
- 1 year ago
I replaced "100" with "1" and it worked.
PC2022
Helper III
1 year agoI used your sequence but unfortunately it didn't work. See screen shot below, it marked all task red. I tried moving "on watch" on top, it marked all tasks yellow.
Anonymous
1 year agoNot applicable
Hi PC2022 ,
Try the expression and if it still doesn't work, please share the sample file:
SchKPI =
VAR DaysUntil = DATEDIFF(TODAY(), msdyn_projecttask[Finish], DAY)
VAR ScheduleStatus = SWITCH(
TRUE(),
msdyn_projecttask[Baseline Finish] = BLANK(), BLANK(),
msdyn_projecttask[% Complete] = 100 && msdyn_projecttask[Finish] <= msdyn_projecttask[Baseline Finish], "On Schedule",
msdyn_projecttask[% Complete] < 100 && DaysUntil < 0, "Off Schedule",
msdyn_projecttask[% Complete] < 100 && DaysUntil < 45, "On Watch",
msdyn_projecttask[Finish] <= msdyn_projecttask[Baseline Finish], "On Schedule",
msdyn_projecttask[Finish] > TODAY(), "On Schedule",
"Error"
)
RETURN ScheduleStatus
Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.