Forum Discussion

iabramson's avatar
iabramson
Frequent Visitor
1 year ago
Solved

Estimated Start and End Times

Hello, I am trying to create a schedule tool that will estimate the start and end times of diffrent steps in a manuifacturing sequence. As the step gets completed data will come in to the start time ...
  • v-venuppu's avatar
    1 year ago

    Hi iabramson ,

    Yes, you can implement this using DAX calculated columns, especially since your Target Time values are stored in a separate lookup table. Here's how you can achieve it:

    1.Your main table (StepsTable, for example) should have a relationship to the TargetTimeLookup table on [Step] or [Seq].

    2.Create Calculated Columns:

    a.Estimated Start Time =
    VAR CurrentType = StepsTable[Type]
    VAR CurrentSeq = StepsTable[Seq]
    VAR PrevStepEndTime =
    CALCULATE(
    MAX(StepsTable[Estimated End Time]),
    FILTER(StepsTable,
    StepsTable[Type] = CurrentType &&
    StepsTable[Seq] = CurrentSeq - 1
    )
    )
    RETURN
    IF(StepsTable[Future] = 1,
    PrevStepEndTime,
    BLANK()
    )

    b.Estimated End Time =
    VAR StartTime = StepsTable[Estimated Start Time]
    VAR TargetTime =
    LOOKUPVALUE(
    TargetTimeLookup[Target Time],
    TargetTimeLookup[Step], StepsTable[Step]
    )
    RETURN
    IF(StepsTable[Future] = 1,
    StartTime + (TargetTime / 24),
    BLANK()
    )

    • Make sure your Target Time is in hours, hence dividing by 24.

    This logic naturally resets at each Type since we filter by [Type] = CurrentType.

    If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

    Thank you.