Power Query Problems

Unpivot Excel Tables with Power Query for PivotTables and Maps

Jason MillerJason Miller Nov 18, 2026 870 views

Question details

Convert department columns into rows and connect related tables for analysis in PivotTables, maps, or a Power Pivot data model.

Unpivot Excel Tables with Power Query for PivotTables and Maps
Product
Microsoft Excel Power Query and Power Pivot
Device & OS
not provided
Scenario
Two tables contain related department data in different layouts, and the user wants to analyze them together.
Observed behavior
A normalized table and a unique department bridge provide a structure for filtering and analyzing both tables.
Before you start

Identify the columns that represent departments and the columns that identify each record. Check that department names are spelled consistently across both tables and that any map source includes a geographic field.

Solution 1Recommended

Unpivot department columns and create a bridge table

Use this approach when department names appear as column headers and neither data table has a unique department column for a direct relationship.

1
Open the wide table

Select a cell in the wide table in Excel, then choose Data > From Table/Range. Confirm the table range and headers if prompted.

2
Unpivot departments

In Power Query Editor, select the department columns, then choose Transform > Unpivot Columns. Keep record identifiers and other descriptive columns unselected.

3
Rename and check fields

Double-click the Attribute header and rename it Department. Rename Value to Count or another appropriate measure, and check the data types using the icons beside the headers.

4
Load the fact tables

Choose Home > Close & Load > Close & Load To, select Only Create Connection, and check Add this data to the Data Model. Prepare and load the other table similarly, ensuring it has a Department column.

5
Build a department bridge

In Power Query, create reference queries from the two tables, keep only each Department column, and use Home > Append Queries to combine them. Select Department, choose Home > Remove Rows > Remove Duplicates, remove blank names, and load the result to the Data Model.

6
Create relationships and analyze

Open Power Pivot > Manage and use Diagram View to connect the bridge table's unique Department column to the Department column in each fact table. Create a PivotTable from the Data Model and use the bridge Department field for shared filtering. For a map, include a suitable geographic field.

Unpivot department columns and create a bridge table
Keep department names consistent: Each department should appear only once in the bridge table. Matching names and compatible data types are needed for relationships to filter both fact tables reliably.
Free Microsoft Office alternative

Explore spreadsheet data with WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for opening and analyzing spreadsheets. Its Excel format support makes it easier to move existing files, but it does not fix Excel Power Query or Power Pivot issues.

Create PivotTables to summarize spreadsheet dataOpen and edit Microsoft Excel XLSX and XLS filesNavigate a familiar spreadsheet interfaceUse a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why should I unpivot department columns?

Unpivoting turns department headers into values in one Department column, with their measures in another column. This makes the data easier to group and filter in a PivotTable.

Why do I need a department bridge table?

If departments repeat in both data tables, neither Department column is suitable as the unique side of a relationship. A bridge with one row per department can connect to both tables in the Data Model.

How do I include the normalized table in the Data Model?

In Power Query Editor, choose Home > Close & Load > Close & Load To, then select Only Create Connection and check Add this data to the Data Model.

Can I make a map using department names alone?

A map needs recognizable geographic information, such as a country, state, city, or coordinates. Include a suitable geographic field in the source data before creating the map.

Will a department filter affect both tables?

It can if the bridge has unique department names and valid relationships to both tables. Use the Department field from the bridge in the PivotTable filter, row area, or slicer.