Forum Discussion

pinar1's avatar
pinar1
Frequent Visitor
6 years ago
Solved

Creating Interconnected Date Columns by Priority Index for Gantt Chart

Hello, 

I am new to the BI and I have searched the Forum to see of I can find a solution. But I couldn't find. So It would be super if somebody could help me with my question. I need to prepare a @Gantt for work but lack some info:  
 
I have the information below: 
Each Resource has different tasks with a priority sequence.
 
ResourceTaskPriority Start DateDuration (day)End Date
Floridasushi1 2 
Floridapasta2 4 
Miamiburito1 1 
Miaminachos2 2 
Miamipizza3 3 
Miamisteak4 1 
 
 
What I need is to create a Start Date column, which will automatically return Today's Date for Priority=1  for each resource and then adds the Duration for End Date column. 
After that, the Task with Priority=2 will have a Start Date equal to the End Date of Priority=1 Task. Then Priority=3 Task will have Start Date equal to End Date of Priority=2 Task. 
So I want to see something like this:
 
 
ResourceTaskPriority    Start DateDuration (day)             End Date
Floridasushi18/30/202029/1/2020
Floridapasta29/1/202049/5/2020
Miamiburito18/30/202018/31/2020
Miaminachos28/31/202029/2/2020
Miamipizza39/2/202039/5/2020
Miamisteak49/2/202019/3/2020

 

 

It would be so much appreciated! 

 

  • pinar1 

    Add the following two columns to your table by going to theTable, New Column:

    Start Date

    Start Date = 
    var T = TODAY()
    VAR P = [Priority ]
    RETURN
    SWITCH( TRUE(),
    P=1, T,
    CALCULATE( T + SUM(Table4[Duration (day)]), Table4[Priority ] < P, ALLEXCEPT(Table4,Table4[Resource]))  
    )

    End Date

    End Date = [Start Date] +[Duration (day)]

     

     





    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn



1 Reply

  • pinar1 

    Add the following two columns to your table by going to theTable, New Column:

    Start Date

    Start Date = 
    var T = TODAY()
    VAR P = [Priority ]
    RETURN
    SWITCH( TRUE(),
    P=1, T,
    CALCULATE( T + SUM(Table4[Duration (day)]), Table4[Priority ] < P, ALLEXCEPT(Table4,Table4[Resource]))  
    )

    End Date

    End Date = [Start Date] +[Duration (day)]

     

     





    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn