Power Query Problems

Split Employees and Dependents into Rows with Excel Power Query

Kushani NimanthikaKushani Nimanthika Dec 2, 2026 868 views

Question details

Create a separate row for each employee and dependent from a source table that combines their information.

Split Employees and Dependents into Rows with Excel Power Query
Product
Microsoft Excel Power Query
Device & OS
not provided
Scenario
An employee table includes optional dependent information on the same row, and the user wants a person-level table.
Observed behavior
The desired output has one row per person, a shared employee identifier, each person's own identifier, and a common Name column.
Before you start

Identify the source columns for the employee ID and name and the dependent ID and name. If the data is not already an Excel table, select it and choose Insert > Table, including the header row.

Solution 1Recommended

Append employee and dependent queries in Power Query

Use two queries with matching columns to create a combined person-level table.

The example below assumes columns named EmployeeID, EmployeeName, DependentID, and DependentName. Substitute your actual column names. The employee's PersonID will be the EmployeeID; the dependent's PersonID will be the DependentID.

1
Import the source table

Select a cell in the Excel table, then choose Data > From Table/Range to open it in Power Query Editor.

2
Create two queries

In the Queries pane, right-click the source query and choose Reference twice. Rename the new queries Employees and Dependents.

3
Prepare employee rows

In Employees, keep EmployeeID and EmployeeName using Home > Choose Columns. Right-click EmployeeID and choose Duplicate Column; rename the duplicate PersonID and rename EmployeeName to Name.

4
Prepare dependent rows

In Dependents, keep EmployeeID, DependentID, and DependentName using Home > Choose Columns. Use the DependentID filter to remove null and blank values, then rename DependentID to PersonID and DependentName to Name.

5
Append and load the result

Choose Home > Append Queries > Append Queries as New, select Employees and Dependents, and confirm. Check that EmployeeID, PersonID, and Name contain the expected values, then choose Home > Close & Load.

Append employee and dependent queries in Power Query
Match the output columns: Append matches columns by name, so both queries must use the same names and compatible data types. Include any additional shared fields in both queries if they are needed in the result.
Free Microsoft Office alternative

Work with employee spreadsheets in WPS Office

WPS Office is a free, lightweight Office alternative with a familiar spreadsheet interface. Open compatible Excel files to review and edit employee tables, making it easier to move everyday spreadsheet work between applications. The Power Query transformation above requires Excel.

Review and edit employee and dependent tables in WPS SpreadsheetOpen and save compatible Microsoft Excel XLSX and XLS filesUse a familiar interface for everyday spreadsheet workMove compatible documents between Office applications
microsoft office alternative - wps office

Frequently Asked Questions

How do I prevent empty dependent rows from appearing?

In the Dependents query, open the DependentID column filter and clear null and blank values before appending the queries.

Why does the employee ID appear twice on an employee row?

The output uses EmployeeID as the shared employee identifier and PersonID as the identifier for the person on that row. For an employee, both values are the employee's ID.

Why did the append create extra columns?

Power Query matches appended columns by name. Check that both queries use exactly EmployeeID, PersonID, and Name, then check their data types in Power Query Editor.

How do I update the result after the source table changes?

After editing or adding rows to the source Excel table, select Data > Refresh All to rerun the queries and update the loaded result.