Unpivot Data Power Query

If you just need to unpivot data power query and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

In Excel: start from Data ▸ Get Data (or Data ▸ From Table/Range) to open the Power Query Editor, shape the data with the ribbon buttons, then Close & Load to drop the result on a sheet.

Annotated stepsExcel
1

Data ▸ Get Data and choose the source, or Data ▸ From Table/Range for data already on a sheet.

2

In the editor, shape the data with the ribbon: Remove Columns, Split Column, Filter, Change Type, Unpivot.

3

Watch the Applied Steps pane on the right — it is the recipe, and any step can be deleted or reordered.

4

Set every column's data type explicitly before loading; it is the step most often skipped.

5

Close & Load, or Close & Load To… if you want a connection only, or a load straight into the Data Model.

6

Afterwards, Data ▸ Refresh All replays every step against the current source.

Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

What this does

Power Query — shown in the ribbon as Get & Transform — is the import-and-clean layer that sits in front of the worksheet. Its defining property is that it RECORDS every step rather than performing it: removing a column, splitting one, changing a type, filtering rows and unpivoting all land as an ordered list in the Applied Steps pane. Point it at next month's file and click Refresh, and the whole sequence replays. That makes it the correct answer to any cleaning job you will do more than once, and to combining a folder of identically shaped files (Get Data ▸ From File ▸ From Folder). Two operations have no practical worksheet equivalent: Unpivot Columns, which turns a wide twelve-month-columns layout into the tall three-column shape every PivotTable wants, and Merge Queries, a join that handles many-to-many where VLOOKUP cannot. It is built into Excel for Windows from 2016 and into Excel for Mac from 2019, though the Mac version supports fewer connectors. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. For “unpivot data power query”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected pivot table change, and only then apply the same setup to the full sheet. When this is a ribbon command, the selection matters more than the button: confirm the range, apply the command, then spot-check the output before saving. That is what makes a data step that keeps your analysis trustworthy useful in real work: repeatable, auditable, and not dependent on memory or luck.

A worked example

Twelve monthly CSV exports in one folder, each with the same headers. Data ▸ Get Data ▸ From File ▸ From Folder ▸ pick the folder ▸ Combine & Transform. Power Query stacks all twelve, and the steps you then add — remove a blank column, set Date to date type, filter out cancelled rows — apply to every file. Next month, drop file thirteen into the folder and press Data ▸ Refresh All. Any cleaning routine you perform more than once is a query you should have built the first time — the second month costs one click instead of an afternoon. If there is any chance you will reuse this, drop it into a small template tab right now: a labelled input area on the left and the formula beside it, checked once against the tool above. Next time the same question comes up, the answer is a single paste away instead of a rebuild from memory.

In Google Sheets

Everything above works in Google Sheets too. Excel and Sheets share the formula syntax used here; only the surrounding menus are arranged differently. That portability is deliberate — learn it once and it follows you between the two tools and across Windows and Mac. Nothing on this page is behind a login: the tool runs entirely in your browser, the formula is shown in full with one-click copy, and the steps work the same on Windows and Mac. That is the whole promise here — the exact answer, a way to prove it on your own numbers, and just enough context to make it stick. The short version of “unpivot data power query”: the answer is at the top of this page, the tool proves it on your own numbers, and the sections above explain why it holds so the next variation does not stump you. Excel rewards people who reference cells instead of typing values and who keep inputs separate from formulas, because that is what makes a result you can audit months later. Build it once, deliberately, with the live tool as a check, and you convert a one-off lookup into a reusable skill — which is the whole point of learning the why and not just the what.

Common mistakes

  • Editing the loaded output on the sheet — the next refresh overwrites it. All edits belong in the query.
  • Skipping Change Type, so numbers arrive as text and every downstream total is wrong or zero.
  • Filtering on a value list, which hard-codes today's values into the step and silently drops new ones later.
  • Combining files whose headers differ slightly; the step records column names, so "Amount " with a trailing space breaks the append.
  • Loading a million rows to a worksheet instead of Close & Load To ▸ Connection Only ▸ Add to Data Model.
  • Building the same clean-up by hand each month when the query already exists and just needs Refresh.

Frequently asked questions

What is Power Query used for?

Importing data from files, folders, databases and the web, and cleaning it with steps that are recorded once and replayed on every refresh.

Where is Power Query in Excel?

On the Data tab as Get Data / Get & Transform. It is built into Excel for Windows from 2016 and Excel for Mac from 2019.

How do I unpivot data?

In the editor, select the columns that should stay, right-click ▸ Unpivot Other Columns. Wide month-per-column data becomes the tall layout PivotTables need.

Can Power Query combine multiple files?

Yes — Get Data ▸ From File ▸ From Folder ▸ Combine & Transform appends every identically shaped file in the folder, and picks up new files on refresh.

Is Power Query better than VLOOKUP?

For repeated joins across whole tables, yes: Merge Queries handles many-to-many and does not recalculate on every edit. For a single lookup in a live formula, XLOOKUP is simpler.