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

Be 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

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.