Forum Discussion

amanda_wahlig's avatar
amanda_wahlig
Frequent Visitor
2 years ago
Solved

Setting up Data for Gantt Chart

I am working to take basic data entered by employees  and transform it in BI into a Gantt Chart.

 

The List populated/updated by the employees will be something like this:

Project

Start DateEnd Phase 1Start Phase 2End Phase 3Start Phase 4End Phase 4
A1/1/23

1/15/23

1/16/231/31/232/1/233/3/23
B11/6/2311/30/2312/1/2312/15/2312/16/231/4/24
C12/3/2312/7/2312/8/2312/31/231/2/241/15/24

 

I would like to show a chart that visually breaks down the entire timeline for project by phases, but having BI create the child rows to the parent row (to avoid having the staff have to enter/create all the child rows). Can you just point me in the direction of the steps to take in BI to do this?

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi amanda_wahlig,

    I think this type of table structure should not be suitable of processed in Gantt chart.

    I'd like to suggest you to unpivot and transform these columns to convert them to attribute and two date fields, then you can simply analysis these records in Gantt chart.

    Raw table:

    Full query:

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Rc7BDYAwCIXhXTg3QaBVr+oYpPuvYbHlefsSfgjudFEhYWG1iQbtKVtTzczYAr043VEIZzvibRF1qP3E2cpavxvPnBiaAzohw4sae/nruNBf", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Project = _t, #"Start Date" = _t, #"End Phase 1" = _t, #"Start Phase 2" = _t, #"End Phase 3" = _t, #"Start Phase 4" = _t, #"End Phase 4" = _t]),
        #"Renamed Columns" = Table.RenameColumns(Source,{{"Start Date", "Start Phase 1"}}),
        #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Renamed Columns", {"Project"}, "Attribute", "Value"),
        #"Split Column by Delimiter" = Table.SplitColumn(#"Unpivoted Columns", "Attribute", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, true), {"Attribute", "Step"}),
        #"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Project", type text}, {"Attribute", type text}, {"Step", Int64.Type}}),
        #"Grouped Rows" = Table.Group(#"Changed Type", {"Project", "Step"}, {{"Content", each Table.PromoteHeaders(Table.Transpose(Table.SelectColumns(_,{"Attribute","Value"})), [PromoteAllScalars=true]), type table}}),
        #"Expanded Count" = Table.ExpandTableColumn(#"Grouped Rows", "Content", {"Start Phase", "End Phase"}, {"Start Phase", "End Phase"})
    in
        #"Expanded Count"

     

    Result:


    Regards,
    Xiaoxin Sheng

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi amanda_wahlig,

    I think this type of table structure should not be suitable of processed in Gantt chart.

    I'd like to suggest you to unpivot and transform these columns to convert them to attribute and two date fields, then you can simply analysis these records in Gantt chart.

    Raw table:

    Full query:

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Rc7BDYAwCIXhXTg3QaBVr+oYpPuvYbHlefsSfgjudFEhYWG1iQbtKVtTzczYAr043VEIZzvibRF1qP3E2cpavxvPnBiaAzohw4sae/nruNBf", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Project = _t, #"Start Date" = _t, #"End Phase 1" = _t, #"Start Phase 2" = _t, #"End Phase 3" = _t, #"Start Phase 4" = _t, #"End Phase 4" = _t]),
        #"Renamed Columns" = Table.RenameColumns(Source,{{"Start Date", "Start Phase 1"}}),
        #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Renamed Columns", {"Project"}, "Attribute", "Value"),
        #"Split Column by Delimiter" = Table.SplitColumn(#"Unpivoted Columns", "Attribute", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, true), {"Attribute", "Step"}),
        #"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Project", type text}, {"Attribute", type text}, {"Step", Int64.Type}}),
        #"Grouped Rows" = Table.Group(#"Changed Type", {"Project", "Step"}, {{"Content", each Table.PromoteHeaders(Table.Transpose(Table.SelectColumns(_,{"Attribute","Value"})), [PromoteAllScalars=true]), type table}}),
        #"Expanded Count" = Table.ExpandTableColumn(#"Grouped Rows", "Content", {"Start Phase", "End Phase"}, {"Start Phase", "End Phase"})
    in
        #"Expanded Count"

     

    Result:


    Regards,
    Xiaoxin Sheng