Power Query vs Power Pivot: What Each One Does
By ExcelReady TeamUpdated 6 min read
The short answer
Power Query and Power Pivot do different jobs, so you usually use them together. Power Query gets data from files, folders or databases and cleans it in steps you can refresh. Power Pivot takes the clean tables, links them with relationships in a Data Model and adds DAX measures for pivot table reports. Query prepares; Pivot models and calculates.
Key takeaways
- Power Query is for getting and cleaning data; Power Pivot is for linking tables and writing calculations.
- Power Query records cleaning steps in the M language; Power Pivot calculations are written in DAX.
- The usual order is Power Query, then the Data Model with Power Pivot, then a pivot table report.
- Power Query is built into Excel for Windows and Microsoft 365 for Mac; Power Pivot is Windows only.
- Learn Power Query first: messy data is a more common problem than needing a multi-table model.
On this page+
Power Query vs Power Pivot is not really a contest: they are two stages of the same job. Power Query gets and cleans data, such as combining monthly files and removing stray spaces. Power Pivot links and calculates: it joins several clean tables in a Data Model and adds DAX measures for pivot table reports. This guide is for analysts and job seekers who keep seeing both names and want to know which one does what, and which to learn first.
Power Query vs Power Pivot at a glance#
Power Query works before the data reaches your report; Power Pivot works on the data that the report reads.
| Feature | Power Query | Power Pivot |
|---|---|---|
| Main job | Import, clean, reshape and combine data | Link tables and calculate with measures |
| Where you find it | Data > Get Data (Get & Transform) | Power Pivot tab, after turning on the add-in |
| Language | M (written for you as you click) | DAX (you write the measures) |
| Typical tasks | Trim spaces, split columns, fix data types, append files, unpivot | Relationships, totals, ratios, distinct counts, time comparisons |
| Output | A table on a sheet, a connection, or the Data Model | A Data Model that feeds pivot tables and pivot charts |
| Updates | Click Refresh to rerun every step on new data | Measures recalculate when the model is refreshed |
| Platforms | Excel for Windows; Microsoft 365 for Mac with fewer data sources | Excel for Windows only |
| Learning curve | Gentle: mostly menus and buttons | Steeper: DAX takes practice |
Both are used in Power BI too, which is why the comparison of Excel vs Power BI says Excel skills carry over.
What Power Query does#
Power Query is a data preparation tool. You connect to a source, such as a CSV file, a folder of monthly exports, a web table or a database, and clean it in the Power Query Editor. Every click becomes a recorded step: remove a column, trim spaces, split "City, Country" into two columns, change text to dates.
The big win is Refresh. Next month, drop the new file in the folder, click Data > Refresh All, and Power Query repeats every step for you. If you have never opened it, start with Power Query for beginners. If you're wondering whether it's better than TRIM and SUBSTITUTE formulas, the article on Power Query vs formulas compares the two on the same messy data, so it isn't repeated here.
What Power Pivot does#
Power Pivot is a data modelling tool. It loads several tables into the workbook's Data Model, lets you link them with relationships (for example, Sales[ProductID] to Products[ProductID]), and lets you write measures in DAX:
Total Sales := SUM(Sales[Amount])
Customers := DISTINCTCOUNT(Sales[Customer])A measure is written once and works in every cell of a pivot table, by any row, column or filter. Power Pivot does not clean data well; it expects tidy tables. Its output is still a pivot table, built from the Data Model. The full comparison with ordinary pivots is in Power Pivot vs pivot table.
To turn it on in Excel for Windows: File > Options > Add-ins, choose COM Add-ins, click Go and tick Microsoft Power Pivot for Excel. If it isn't in the list, your edition may not include it.
The same report built with each tool#
Here is a typical task: twelve monthly sales exports, each with messy customer names, plus a separate product list. The manager wants sales by product category and the number of different customers.
Power Query's part#
- Data > Get Data > From File > From Folder and pick the folder of exports. Combine the files into one table.
- Select the Customer column and choose Transform > Format > Trim to remove stray spaces.
- Set the data types: Date as a date, Amount as a decimal number.
- Close & Load To… and tick Add this data to the Data Model. Load the product list the same way.
Power Query has now done its job: one clean Sales table and one Products table. It can't link them in a report or count distinct customers by category for you.
Power Pivot's part#
- Open Power Pivot > Manage and switch to Diagram View.
- Drag ProductID from Sales onto ProductID in Products to create a relationship.
- Add the two measures above: Total Sales and Customers.
- Insert a pivot table from the Data Model: Category in Rows, both measures in Values.
Now the report shows sales and distinct customers by category, with no VLOOKUP helper columns. Next month, Refresh All reruns the Power Query steps and the pivot updates.
The exercise on this page shows why step 2 of Power Query matters: with stray spaces, "Acme" and "Acme " are different customers, and a total for Acme comes out too low.
When to use Power Query#
Use Power Query when the problem is the data itself: where it comes from or how messy it is. It is the right choice when:
- You repeat the same clean-up every week or month on a new export.
- You combine files, such as one CSV per month or one sheet per region.
- The layout is wrong, for example months across the columns that need to be unpivoted into rows.
- You use a Mac. Power Query in Microsoft 365 for Mac covers common file sources; Power Pivot isn't available.
- You only need a clean table on a sheet, with ordinary formulas or a normal pivot on top.
When to use Power Pivot#
Use Power Pivot when the problem is the analysis: several tables, lots of rows, or calculations a normal pivot can't do. It is the right choice when:
- Your report needs fields from several tables and you are tired of lookup helper columns.
- The data is too big for a sheet, beyond 1,048,576 rows, or big enough to slow formulas down.
- You need measures such as distinct counts, ratios or year-to-date totals that stay right at every level of the pivot.
- You plan to learn Power BI, which uses the same DAX language.
For one tidy table, neither tool may be needed: a normal pivot table or SUMIFS does the job, as the article on pivot tables vs SUMIFS explains.
Common mistakes#
These mix-ups come up most often:
- Trying to clean data in Power Pivot. Calculated columns can patch problems, but trimming, splitting and fixing types belong in Power Query, before the data reaches the model.
- Writing DAX in Power Query or M in Power Pivot. They are different languages.
SUM(Sales[Amount])is DAX;Text.Trimis M. - Loading huge tables to a sheet. If the data is only for a report, choose Only Create Connection and Add this data to the Data Model instead of loading to a worksheet.
- Expecting Power Pivot on a Mac. It is Windows only, so share files with Mac users as clean tables and normal pivots.
- Forgetting to refresh. Neither tool updates by itself when the source file changes. Use Data > Refresh All.
- Using both for one small table. If the data is already clean and fits on a sheet, an Excel table or a regular pivot table is faster to build and easier for others to follow.
Our recommendation#
Learn Power Query first. Messy, repeated imports are the most common data problem at work, Power Query solves them with menus rather than code, and it works on both Windows and Mac. Add Power Pivot when your reports need several linked tables, more rows than a sheet holds, or measures like distinct counts.
In short: Power Query to get the data clean, Power Pivot to link it and calculate, and a pivot table to show the result. Before either, make sure your pivot table and text-cleaning basics are solid, because job tests check those far more often.
Practise it#
Both tools build on everyday skills. Practise cleaning messy text with TRIM and friends to see the problems Power Query fixes, then practise grouping and summarising in the second pivot table lesson, which is where Power Pivot results end up. Each lesson runs in a live spreadsheet and checks your work instantly. Then try the exercise on this page to see how stray spaces change a total.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
These customer names have stray spaces, so SUMIF misses some of Acme's orders. In G2, total Acme's amounts by trimming the names first, as a Power Query clean-up would: =SUMPRODUCT((TRIM(B2:B7)="Acme")*D2:D7).
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Amount | |||||||
| 2 | Acme total | |||||||
| 3 | ||||||||
| 4 | ||||||||
| 5 | ||||||||
| 6 | ||||||||
| 7 | ||||||||
| 8 | ||||||||
| 9 | ||||||||
| 10 |
Tip: TRIM removes the extra spaces from every name, the test gives TRUE for each Acme row, and multiplying by D2:D7 keeps only those amounts. The answer is 1150, while =SUMIF(B2:B7,"Acme",D2:D7) finds only 500.
Practise this in a lesson
Frequently asked questions
What is the difference between Power Query and Power Pivot?
Power Query imports and cleans data, such as removing spaces, splitting columns and combining files. Power Pivot builds a Data Model that links several tables with relationships and calculates totals with DAX measures. Power Query prepares the data and Power Pivot analyses it.
Should I learn Power Query or Power Pivot first?
Learn Power Query first. Most people spend more time cleaning and combining data than modelling it, and Power Query helps on Windows and Mac. Move to Power Pivot when you need to link several tables or write measures.
Do I need both Power Query and Power Pivot?
Not always. Power Query alone is enough to clean data and load it to a sheet. Power Pivot alone works with tables that are already clean. They work best together when you report on several large, messy tables.
Is Power Query the same as Power BI?
No, but Power BI uses the same technology. Power BI Desktop has Power Query for getting data and a data model with DAX, much like Power Pivot, so skills from Excel carry over.
What language does Power Pivot use?
Power Pivot uses DAX (Data Analysis Expressions) for measures and calculated columns. Power Query uses a different language called M, which it writes for you as you click through the cleaning steps.