Forum Discussion

SAW's avatar
SAW
Frequent Visitor
3 years ago
Solved

Idle time

I have a list of projects that can have 1-5 different phases over the course of the project.  These phases can run in any order for a particular project, including concurrently with other phases.  Wh...
  • Bifinity_75's avatar
    3 years ago

    Hi SAW , try this:

     

    - Insert a Index column in Power Query

    - Create a calculate column with this formule:

    Result = 
    VAR Star_d=CALCULATE(MAX('Table'[Phase Start]),FILTER('Table','Table'[Index]=EARLIER('Table'[Index])+1))
    VAR Completed_d=CALCULATE(MAX('Table'[Phase Completed]),ALLEXCEPT('Table','Table'[Project]),'Table'[Phase]<>"Completion")
    return
    SWITCH(
        TRUE(),
    'Table'[Phase Completed]-Star_d>0,0,
    Star_d>Completed_d,Star_d-Completed_d-1,
    Star_d-'Table'[Phase Completed]-1
    )

    With the small sample you have sent, it works:

     

    Best regards