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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
matiellu
Regular Visitor

Gantt 2.2.3 - How to create a Gantt by project phases.

How to create a Gantt by project phases, data source: Excel

There are 5 steps with start and end dates, but the "Gannt 2.2.3" viewer only allows you to insert 1 step.

can you help me?

 

matiellu_0-1678744256927.png

 




1 REPLY 1
MFelix
Super User
Super User

Hi @matiellu ,

 

For this you need to pivot your table with Start and End dates you need the final result to look like this:

MFelix_0-1679010869192.png

 

See below the complete code for the transformation, I changed a little bit the name of the columns so that everything would match.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("VdBLCgMhEEXRvThusKrUTvcw301I738bsYihruDkKhx49p7uaUuiWSybmHkcefSIMkINITWP839pCAfaL66tp4dfGc2TZqFJRneatphPvyowVWhWmmT0RrMs5muOClNpNppk9KBZF/M9R4XJL/SFYZLRk2ZbzM8cFSa/0BeGScaE5h7m9QU=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Project = _t, Sprint0 = _t, #"Sprint0 Ends" = _t, Dev = _t, #"Dev Ends" = _t, Prod = _t, #"Prod Ends" = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Project"}, "Attribute", "Value"),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Unpivoted Other Columns", "Attribute", Splitter.SplitTextByDelimiter(" ", QuoteStyle.Csv), {"Task", "Type"}),
    #"Replaced Value" = Table.ReplaceValue(#"Split Column by Delimiter",null,"Start",Replacer.ReplaceValue,{"Type"}),
    #"Pivoted Column" = Table.Pivot(#"Replaced Value", List.Distinct(#"Replaced Value"[Type]), "Type", "Value"),
    #"Changed Type" = Table.TransformColumnTypes(#"Pivoted Column",{{"Project", type text}, {"Task", type text}, {"Start", type date}, {"Ends", type date}})
in
    #"Changed Type"

Now just do the Gantt:

MFelix_1-1679011023219.png

 

See file attach.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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