Power Query Problems

How to Convert Multiple Rows into One Row in Excel Using Power Query

Tauseeq MagsiTauseeq Magsi Nov 10, 2026 870 views

Question details

The user needs to consolidate downloaded server data where individual records are spread across up to seven rows into a single row per record.

How to Convert Multiple Rows per Record Into One Row in Excel
Product
Excel
Device & OS
not provided
Scenario
Reformatting unorganized downloaded server data for reporting, where blank rows occasionally appear if a record has fewer entries.
Observed behavior
Each record currently spans multiple vertical rows instead of being neatly organized horizontally across columns on a single row.
Before you start

Before attempting to transform your data, ensure your source dataset is formatted as an official Excel Table by pressing Ctrl+T, which makes it easier to load into Power Query and allows seamless updates later.

Solution 1Recommended

Use Power Query to Group and Pivot Data

Power Query is the most practical and dynamic method to clean this type of data, as it allows you to group by a record identifier and pivot the attributes into columns without manual copy-pasting.

Power Query can automate the data cleaning process. By setting up the query once, you can reuse it indefinitely whenever new server data is generated.

1
Load Data into Power Query

Select any cell in your source data table, navigate to the 'Data' tab on the Excel ribbon, and click 'From Table/Range' to open the Power Query Editor.

2
Create a Unique Record Identifier

If your records lack a unique ID, go to 'Add Column' > 'Index Column' or use 'Conditional Column' to assign a group ID to each block of related rows.

3
Filter Out Blank Rows

Click the dropdown arrow on your data column header and uncheck '(Null)' or '(Blank)' to remove empty rows caused by missing entries in the server export.

4
Pivot the Data Column

Select the column containing your attribute names. Go to the 'Transform' tab and click 'Pivot Column'. In the dialog box, choose the column containing your actual data values. Click 'Advanced options' and select 'Don't Aggregate', then click OK.

5
Load the Result to a Worksheet

Once the data looks correct, go to the 'Home' tab and click 'Close & Load'. This will output the consolidated, single-row records into a new Excel worksheet.

Use Power Query to Group and Pivot Data
Automatic Updates: Whenever new source data is added to the original table, simply right-click any cell in your new consolidated result table and select 'Refresh' to update it instantly.
Free Microsoft Office alternative

Try WPS Office for Seamless Data Management

Need a lightweight, fast, and highly compatible tool for your daily spreadsheets? WPS Office is a powerful alternative to Microsoft Office that perfectly handles complex data tables without the heavy system requirements.

Fully compatible with Microsoft Excel (.xlsx, .xls) and CSV file formats.Powerful built-in functions, PivotTables, and data filtering tools for organizing multi-row records.Familiar, tabbed user interface making it incredibly easy to learn and migrate to.Free and lightweight, avoiding the slow loading times of heavier spreadsheet software.
QA img-9

Frequently Asked Questions

Can I consolidate multiple rows into one using standard Excel formulas instead of Power Query?

Yes, you can use functions like INDEX, MATCH, or the newer FILTER and TEXTJOIN functions to restructure your data. However, this often requires complex formula setups and manual adjustment when the dataset size changes, making Power Query the preferred method.

How do I update the Power Query result when my server data changes?

Simply paste or append the new server data into your original source table. Then, navigate to the consolidated worksheet, right-click anywhere inside the result table, and select 'Refresh'.

Why did Power Query aggregate my data when pivoting the columns?

By default, Power Query tries to count or sum values when pivoting. To prevent this behavior, ensure you click 'Advanced Options' in the Pivot Column dialog box and select 'Don't Aggregate' before confirming.