Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
dpblue
New Member

Project Task assessment calculation problem

For example, I have 3 tasks that all have an immediate preceding relationship,task2 start as task1 finished,
1 <- 2 <- 3
task1 has a scheduled start time of 1 and a scheduled completion time of 1, 2 has a scheduled start time of 1 and a scheduled completion time of 2, and so on.
Now the problem is, if due to 1, task 2 is not started, so the completion time is also delayed, in this case, the assessment criteria is only task 1 is not completed, the delay is 1 day, task 2, 3 is normal, the assessment is "actual completion time" - "planned completion time ", so the last column should be 1, are delayed by one day, but task 2, 3 is due to task 1 delay caused by, so to remove the 2 tasks of the delay to 0,how can i do this using Dax?

TaskIDPlanedStartPlanFinishActualStartActualFinishPredecessorDeLayActualDelay
11112 11
22233110
33344210
1 REPLY 1
technolog
Super User
Super User

To achieve this in DAX, you can create a calculated column for ActualDelay. Here's how you can do it:

First, you need to determine if the task's actual start time is delayed due to its predecessor. If the task's actual start time is greater than its planned start time and the predecessor's actual finish time is greater than the predecessor's planned finish time, then the task is delayed due to its predecessor.

Now, for the ActualDelay calculation:

If a task is delayed due to its predecessor, set ActualDelay to 0. Otherwise, calculate the delay as the difference between the actual finish time and the planned finish time.

Here's the DAX formula for the ActualDelay column:

ActualDelay =
VAR CurrentTaskID = Tasks[TaskID]
VAR PredecessorID = Tasks[Predecessor]
VAR PredecessorActualFinish = LOOKUPVALUE(Tasks[ActualFinish], Tasks[TaskID], PredecessorID)
VAR PredecessorPlanFinish = LOOKUPVALUE(Tasks[PlanFinish], Tasks[TaskID], PredecessorID)

RETURN
IF(
AND(
Tasks[ActualStart] > Tasks[PlanedStart],
PredecessorActualFinish > PredecessorPlanFinish
),
0,
Tasks[ActualFinish] - Tasks[PlanFinish]
)
In this formula, we're using the LOOKUPVALUE function to get the actual and planned finish times of the predecessor task. We then determine if the current task is delayed due to its predecessor. If it is, we set ActualDelay to 0. Otherwise, we calculate the delay as the difference between the actual and planned finish times.

I hope this helps! Let me know if you have any questions or need further clarification.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.