Unpivot: columns become rows

Plans and budgets usually come as a wide Excel table: one row per region, one column per month. That is the wrong shape for Power BI. Unpivoting turns it into a long table you can filter, sum and connect to a date table.

In short: select the descriptive columns (such as Region), then Unpivot Other Columns. Each month column becomes rows with the columns Attribute (the old column name) and Value.

Prerequisites: Append queries.

Try it now

Task The budget comes from Excel with one column per month. Power BI needs a long table: one row per region and month. Unpivot every column except Region.

ABCD
1 Region Jan Feb Mar
2 North 12000 11500 13000
3 South 9800 10200 9900
4 West 14000 13600 15100

Why the long shape?

In the wide table the month hides in the column name. Power BI can neither filter nor group by it, and every month would need its own measure. In the long shape the month is a value in a column: a single measure SUM(Plan[Value]) is enough, and a slicer on the month works just like for sales.

Wide (Excel plan)Long (for Power BI)
Region | Jan | Feb | MarRegion | Attribute | Value
North | 12000 | 11500 | 13000North | Jan | 12000
North | Feb | 11500
North | Mar | 13000

Other columns or selected columns?

Power Query offers both: Unpivot Columns takes the selected columns, Unpivot Other Columns all except the selected ones. The second is almost always right: when an Apr column is added in April, it is unpivoted automatically on refresh. With Unpivot Columns it would stay put and April would be missing from the report.

One more exercise: two descriptive columns

Task The plan has two descriptive columns (Region, Category) and one column per year. Unpivot the years and keep Region and Category.

ABCD
1 Region Category 2025 2026
2 North Hardware 52000 56000
3 North Software 18000 21000
4 South Hardware 47000 49500
5 South Software 15500 17200

This exercise is part of Premium.

Premium unlocks every exercise in every lesson, unlimited practice with fresh tasks and the final test with certificate.

See Premium Already Premium? Log in

The first exercise in this lesson is free.

In real Power BI

  1. Select: Ctrl-click the columns that should stay.
  2. Unpivot: Transform, Unpivot Columns, Unpivot Other Columns.
  3. Tidy up: rename Attribute and Value by double-clicking (Month, Budget) and check the data types.

Common mistakes

Total column unpivoted too

If the Excel table has a Total column on the right, it becomes a "Total" row and doubles every sum in the report. Remove it first.

Total row at the bottom

The same goes for a "Total" row at the end of the Excel table. Filter it out before you unpivot.

Frequently asked questions

What happens to empty cells?

Power Query leaves them out when unpivoting. For plan values that is usually right; if you need a zero, replace null with 0 first.

Is there a way back?

Yes, Pivot Column under Transform. Power BI rarely needs it, because the matrix pivots in the report anyway.

Learn this next: group by

Summarize rows into sums and counts while loading.

Group by

Write to us

Choose language

Select your preferred language