Power Query Problems

How to Convert Multiple Event Phases from One Row into Gantt Chart Rows

Olivia MillerOlivia Miller Oct 13, 2026 871 views

Question details

The user needs to transform event phase data stored in a single row into multiple rows to create a Gantt chart.

How to Convert Multiple Event Phases from One Row into Gantt Chart Rows
Product
Spreadsheet
Device & OS
not provided
Scenario
Preparing a large dataset containing event phases and dates for a Gantt chart visualization.
Observed behavior
Data is structured horizontally with multiple phases and dates in one row, but needs to be restructured vertically so each phase has its own row with corresponding start and end dates.
Before you start

Ensure your dataset contains a unique identifier, such as an Event ID, which is essential for accurately unpivoting and grouping the data in Power Query.

Solution 1Recommended

Use Power Query to Restructure the Data

The most efficient method for large datasets is to use Power Query to unpivot the phase columns and then pivot the date types.

Power Query is highly recommended for this scenario because it effortlessly handles large volumes of data and allows you to automate the transformation process. By unpivoting the columns, you convert the wide data format into a long format, which is required for plotting Gantt charts.

1
Load data into Power Query

Select your data table, navigate to the Data tab, and click 'From Table/Range' to open the Power Query Editor.

2
Unpivot phase columns

Select the 'Event ID' column, right-click on the column header, and choose 'Unpivot Other Columns'. This will collapse all your event phases and dates into two new columns: Attribute and Value.

3
Clean and split the phase text

Select the new Attribute column. If there is a 'Phase' prefix, use the 'Replace Values' feature to remove it. Then, use 'Split Column' by delimiter to separate the phase name from the date type (Start or End).

4
Pivot the date type column

Select the column that contains the 'Start' and 'End' identifiers. Go to the Transform tab, click 'Pivot Column', and select your date values column as the Values Column. Ensure the advanced options are set to 'Don't Aggregate'.

5
Convert to date format

Select the newly created Start Date and End Date columns, click the data type icon in the column header, and change the data type to 'Date'. Finally, click 'Close & Load' to output the restructured data.

Use Power Query to Restructure the Data
Data formatted for Gantt Charts: Your data is now in a tabular format with one phase per row, making it fully compatible with standard Gantt chart insertion.
Free Microsoft Office alternative

Try WPS Office for Seamless Spreadsheet Management

While Power Query is a built-in feature of Microsoft Excel, WPS Office offers a free, lightweight, and highly compatible alternative for data processing and Gantt chart creation. Enjoy seamless format compatibility and a familiar user interface.

Free and lightweight alternative to Microsoft OfficeFully compatible with Microsoft Excel (.xlsx) formatsFamiliar UI makes data formatting and chart creation intuitiveSupports advanced formulas for dynamic data restructuring
microsoft office alternative - wps office

Frequently Asked Questions

What does unpivoting data do in Power Query?

Unpivoting transforms columns into rows, changing a wide dataset into a long dataset. This is essential when multiple event phases are spread horizontally across columns but need to be separate vertical records for chart generation.

Can I restructure this data using just spreadsheet formulas?

Yes, you can use a combination of INDEX, MATCH, and IF functions to restructure the data. However, Power Query is generally preferred for larger datasets to ensure better performance and easier updates.

Why are my Start and End Dates not recognized correctly by the Gantt Chart?

After pivoting your date columns in Power Query, you must explicitly change their data type to 'Date'. If they are left as text or general formatting, the Gantt chart will not be able to plot the timeline correctly.

How do I remove prefixes from my phase names during transformation?

You can use the 'Replace Values' feature in the Power Query Editor to find the specific prefix (e.g., 'Phase ') and replace it with a blank space, or use the 'Split Column' feature to separate the text before pivoting.