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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
amanda_wahlig
Frequent Visitor

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?

1 ACCEPTED SOLUTION
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:

2.png

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:

1.png
Regards,
Xiaoxin Sheng

View solution in original post

1 REPLY 1
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:

2.png

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:

1.png
Regards,
Xiaoxin Sheng

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.