Power Query or Power Pivot: Which One Does the Thing You Are Trying to Do
Two tools, both bolted onto Excel, both with Power in the name, and they do entirely different jobs. The confusion costs people months, because the wrong one turns a fifteen minute task into a week of nested formulas.
What you do: everything that changes the shape of the data goes in Power Query, before it lands. Everything that measures the data goes in Power Pivot, after it lands.
The short version. Power Query is the kitchen. Power Pivot is the till.
The dividing line
| Power Query | Power Pivot | |
|---|---|---|
| When it runs | On refresh, before the data lands | When a pivot or a formula is evaluated |
| Language | M | DAX |
| Works on | Rows and columns as they arrive | Tables already loaded, and relationships |
| Where you find it | Data tab, Get and Transform | Data tab, Manage Data Model |
| Output | A table, or a connection into the model | Measures and calculated columns |
Power Query is best at these four
- Combining files. Point it at a folder and it appends every file in it. Twelve monthly extracts become one table, and next month's file joins automatically.
- Unpivoting. A report with twelve month columns becomes a long table with a month column, in two clicks. This is the single highest-value thing Power Query does, because almost all awkward Excel data is wide when it should be long.
- Cleaning that must repeat. Trim, split, change type, remove the top four junk rows. The steps are recorded, so next month you press refresh instead of remembering.
- Merging tables. A proper join with a chosen join type, rather than a lookup down a column.
Power Pivot is best at these four
- Relationships. Several tables joined once in a model, rather than lookups copied into every table.
- Measures reused everywhere. Define Revenue once and every pivot in the file uses that definition. When it changes, it changes in one place.
- Calculations that respond to filters. Share of total, year to date, same period last year. These are hard in a normal pivot and natural in DAX.
- More rows than a worksheet holds. The model is not the grid, so the million row limit from the row limit page does not apply.
The order of operations
Power Query, then the Data Model, then measures, then the pivot. That order is not a preference, it is the flow of the data, and building against it is where slow workbooks come from.
Source file -> Power Query (clean, reshape, combine)
-> Data Model (tables plus relationships)
-> DAX measures
-> PivotTable / chart on the sheet
The classic mistake is loading raw data to a sheet, then bolting 200,000 SUMIFS onto it. Every one of those recalculates constantly. Move the same work up into the query and it happens once per refresh.
Which one fixes your problem
| Problem | Tool |
|---|---|
| Twelve files to append every month | Power Query, from folder |
| Month names spread across columns | Power Query, unpivot |
| Same lookup pasted into four tables | Power Pivot, one relationship |
| Percent of total that respects slicers | Power Pivot, DAX measure |
| Workbook takes two minutes to open | Power Query, move work into the load |
| File is 3 million rows | Power Query into the model, no worksheet |
| Need last year's value beside this year's | Power Pivot, time intelligence |
| Ten junk rows at the top of every export | Power Query, remove top rows |
Getting started with each
Power Query. Data, Get Data, From File. Do one transform, then look at the Applied Steps list on the right. That list is the whole idea: a recorded, editable, re-runnable recipe. Delete a step and the data goes back.
Power Pivot. Data, Manage Data Model. Add tables, drag a key from one to another to build a relationship, then create a measure with Revenue := SUM(Sales[Amount]). If a measure returns the same number in every row of a pivot, the relationship is missing or pointing the wrong way.
How to apply this to your own work
- Open your slowest workbook and count the formulas that repeat down a column. Those are candidates for the query step.
- Take the monthly file-combining job you do by hand and rebuild it as a folder query once. It pays for itself the first month.
- Find any lookup column you have pasted into more than one table and replace it with a relationship.
- Write down your three most-used calculations and turn them into measures with names people can say out loud.
- After each change, refresh and check a total against the old version. Moving work between layers is exactly where numbers quietly shift.
The one habit to keep
Ask where a calculation belongs before you write it. Load time or read time. That single question keeps the model clean and it is the same question you will answer again in Power BI, where the two tools are the same two tools with different names on the tabs.
What is the oldest repeated cleaning job in your week, and could a query do it once?
Excel for Analysts is 378 pages that read every formula and dialog one at a time, so the workbook stops being a place where numbers appear and becomes one you can check.
Excel for Analysts, $19 →Power Query for beginners is the hands-on version, and the star schema covers the model shape both tools want. The Excel Kit has the drills.
Read Power Query for Beginners →