# How to Unpivot Columns in Power Query | Storek

> Turn a wide export with one column per month into a tidy table in Power Query: promote headers, Unpivot Other Columns, rename, and fix the data types.

Source: https://storek.io/blog/power-query-unpivot-wide-exports

1.  [Home](https://storek.io/)
2.  [Blog](https://storek.io/blog)
3.  How to Unpivot Columns in Power Query

Platform how-to

# Unpivoting wide exports in Power Query, step by step

A column per month looks fine in a spreadsheet and fights you in a report. Unpivoting turns it into the long shape Power BI expects, and it takes about five clicks.

Storek teamJune 10, 20254 min read

![Funnel of 432 budget rows after unpivoting, 144 for Operations, 36 in Q4 and 9 over plan, with the Q4 stage opened into a table of month, cost centre, budget line and amount.](https://storek.io/blog/power-query-unpivot-wide-exports/hero.webp)

Sample dataA wide budget export reshaped, then drilled. Illustrative data.

On this page

1.  [Wide versus long](#wide-versus-long)
2.  [Step by step](#step-by-step)
3.  [Check that nothing was lost](#check-that-nothing-was-lost)
4.  [Common snags](#common-snags)
5.  [When every export needs reshaping](#when-every-export-needs-reshaping)

Jonah, the controller at Tidewater Clinics Group, gets the annual budget as a spreadsheet: one row per department, one column per month, Jan through Dec. It reads well on screen. But when he loaded it into Power BI, he couldn’t put months on a chart axis, couldn’t relate the budget to the date table, and every new “variance by month” visual needed twelve separate fields.

The fix is to unpivot. Power Query does it natively, and once it’s set up, it repeats on every refresh.

## Wide versus long

A **wide** table has one column per period or category. A **long** table has one row per item per period, with the period in its own column. Reports, slicers and relationships all expect long.

Department

Jan

Feb

Mar

… Dec

Marketing

41,800

43,200

44,900

…

Sales

57,500

58,100

60,400

…

Operations

70,200

71,600

72,300

…

Sample dataWide: a column per month.

Department

Month

Budget

Marketing

Jan

41,800

Marketing

Feb

43,200

Marketing

Mar

44,900

Sales

Jan

57,500

Sample dataLong: one row per department per month.

1.  **Load**Home > Transform data

3.  **Promote headers**First row becomes names

5.  **Unpivot Other Columns**Keep Department

7.  **Rename and type**Month, Budget, real date

Four moves, recorded as Applied Steps, replayed on every refresh.

## Step by step

1.  ### Load the file into Power Query

    In Power BI Desktop, use **Home > Get data** to pick the file, then **Transform Data** in the preview (or **Home > Transform data** for a query you already have). In Excel, use **Data > From Table/Range** or **Data > Get Data**.

2.  ### Promote headers and remove junk rows

    If the month names appear as the first data row, use **Home > Use First Row as Headers** (also under **Transform**). Remove title rows or blank rows above it with **Home > Remove Rows > Remove Top Rows**, and drop any total row or column so it doesn’t get unpivoted as a month.

3.  ### Select the columns to keep, then unpivot the rest

    Select the identifier columns, here just **Department**. Then go to **Transform > Unpivot Columns** dropdown and choose **Unpivot Other Columns** (it’s also on the right-click menu). Power Query produces two new columns, **Attribute** and **Value**.

    Unpivot Other Columns is usually the right choice for exports, because if next year’s file adds a column, it gets unpivoted too. If you select the month columns and choose **Unpivot Columns** instead, the step records which columns to keep, so new columns are also picked up; **Unpivot Only Selected Columns** locks in exactly the ones you chose.

4.  ### Rename and fix types

    Double-click the headers to rename **Attribute** to Month and **Value** to Budget. Set Budget’s type to **Decimal Number** or **Fixed Decimal Number** with **Transform > Data Type**. Values often arrive as text, which breaks sums.

5.  ### Turn month names into real dates

    “Jan” alone won’t relate to a date table. Add a column with **Add Column > Custom Column**, for example `Date.FromText("1 " & [Month] & " 2026")`, set it to type **Date**, and relate that column to your date table in Model view.

## Check that nothing was lost

-   **Row count**: a wide table of 3 departments by 12 months should become 36 rows. Power Query drops null cells during the unpivot, so fewer rows means some cells were empty. Decide whether that’s right.
-   **Totals**: add a quick total in both shapes, for example a sum of the Budget column versus the original grand total.
-   **Round trip**: on a duplicate query, use **Transform > Pivot Column** on Month to rebuild the wide table, and compare.

## Common snags

-   **Two header rows** (a year above months): merge them into one header first, or unpivot and then split the Attribute column with **Split Column > By Delimiter**.
-   **A lookup file explains the column codes**: some systems export cryptic column names plus a second file that says what each means. After unpivoting, merge that file in with **Home > Merge Queries**. We cover this shape in [wide exports with a lookup table](https://storek.io/blog/wide-export-lookup-table-unpivot).
-   **Inconsistent month spellings**: use **Replace Values** on the Month column before converting to dates. More in [cleaning data in Power Query](https://storek.io/blog/power-query-clean-data-leading-zeros).

Once the budget is long, it fits neatly as a fact table next to actuals, as described in [star schema basics](https://storek.io/blog/power-bi-star-schema-basics). If variance totals then look off, see why Power BI numbers don’t match Excel.

## When every export needs reshaping

One unpivot is easy. A dozen sources, each with its own odd layout and each changing shape now and then, is where the hours go.

If that’s more reshaping than you want to maintain, Storek does it for you. Add the files to [one place](https://storek.io/platform/lake), and it recognizes wide layouts, including the column-codes-plus-lookup pair, and unpacks them into tidy tables. It tells you when a source gains columns, so you can [ask questions in plain words](https://storek.io/platform/ask).

About the examples

The company, people and figures in this article are illustrative.

## Sources

1.  [Unpivot columns](https://learn.microsoft.com/en-us/power-query/unpivot-column) · Microsoft Learn · checked November 13, 2026
2.  [Data types in Power Query](https://learn.microsoft.com/en-us/power-query/data-types) · Microsoft Learn · checked November 13, 2026

Data loadingData pipelinesBI tools

## Keep reading

[Platform · The sorting office**Bring any file or system. Storek sorts it.**Open the page →](https://storek.io/platform/lake)[Platform how-to**Make Sense of Very Wide Exports Without the Grind**Read the article →](https://storek.io/blog/wide-export-lookup-table-unpivot)[Platform how-to**From Scattered Spreadsheets to One Picture**Read the article →](https://storek.io/blog/scattered-spreadsheets-to-one-picture)

FAQ

## Questions, answered.

What does unpivot do in Power Query?

It turns columns into rows. A table with one column per month becomes a table with an Attribute column holding the month name and a Value column holding the number, so each row is one department in one month.

What is the difference between Unpivot Columns and Unpivot Other Columns?

Unpivot Other Columns keeps the columns you selected and unpivots everything else, so a new month column added later is unpivoted on refresh. Unpivot Columns and Unpivot Only Selected Columns work on the columns you picked, so new columns are left as they are.

Why are my unpivoted values text?

If the header row was read as data, or the columns were typed as text before the unpivot, the Value column ends up as text. Promote headers first, then set the Value column's data type to a number after the unpivot.

Can I reverse an unpivot?

Yes. Select the Attribute column and use Transform > Pivot Column, choosing the Value column as the values. It's handy for checking that nothing was lost.

Book a demo

## See your own data, delivered.

30 minutes. Your data or our sample. No slide deck. Pick a time straight after the form.
