What is Power Query?
Power Query is a “data transformation and data preparation engine,” in Microsoft’s words. It is an interface for connecting to sources and an editor for transforming them, the same in Excel and in Power BI.
On Excel’s ribbon, its commands sit in the Get & Transform Data group. Excel’s help describes its work in four phases:
- Connect to a source: workbook, CSV, folder, database, online service.
- Transform: remove rows, rename, set data types, unpivot, without touching the source.
- Combine: stack tables with the same shape, or merge two on a shared column.
- Load the result into a worksheet or into the Data Model (related tables stored in the workbook, outside the worksheets).
What changes everything for recurring reporting: each action is recorded as a step. You show Power Query once what to do with the January export; in February, it repeats the same steps on the new file by itself: a “repeatable process,” as Microsoft puts it.
That is the job of an ETL tool. Power Query stores nothing itself: Excel or Power BI decides where the result goes.
What Power Query is used for, and what it replaces
If your monthly report starts with “I open the export, delete the first rows, paste it below the others,” you are doing its job by hand:
| What you do by hand | What Power Query does | The command |
|---|---|---|
| Paste each export under the previous ones | It reads and stacks every file in a folder, including those added later. | From Folder |
| Delete the title and total rows | Steps, replayed on each file. | Remove Rows, filters |
| Copy VLOOKUPs down thousands of rows | A join, done once for the whole column. | Merge Queries |
| Reshape a budget entered with the months in columns | The twelve columns become two: the month and the amount. | Unpivot Columns |
| Rerun a macro recorded on fixed cells | A list of readable steps that target columns by name. | Applied Steps pane |
It does not replace what comes next: pivot tables, formulas, charts and layout remain Excel’s job (Excel dashboard).
Where is Power Query in Excel, and do you need to enable it?
In Excel 2016 and later, including Microsoft 365, Power Query is built in: Data tab, Get & Transform Data group, Get Data button. There is nothing to download or enable.
| Your version | Where to click | Good to know |
|---|---|---|
| Microsoft 365, Excel 2016, 2019, 2021 and 2024 (Windows) | Data > Get Data; for the editor alone, Get Data > Launch Power Query Editor | Since version 2510, Get Data opens a new dialog for finding sources. |
| Excel 2010 and 2013 (Windows) | A Power Query tab, after installing a free add-in | Add-in deprecated by Microsoft in the summer of 2019; it still works, with no guarantee for how long. |
| Microsoft 365 for Mac | Data > Get Data (Power Query) | Editor since version 16.69. Sources: workbooks, text or CSV, XML, JSON, SharePoint lists, OData. A folder query can be refreshed but not created. Editor for subscribers only: perpetual-license Mac versions (2016 to 2024) do not have it. |
| Excel for the web | Data > Refresh All; Get Data to import | Viewing and refreshing for all Microsoft 365 subscribers; more features with Business plans and Enterprise plans (E3 and above). |
| Power BI Desktop | Home > Transform data | The same editor; you leave it with Close & Apply. |
The editor also opens when you import a source and choose Transform Data; to reopen an existing query, go to Data > Queries & Connections.
On Windows, From Folder, the connector used in step 1 of the tutorial, is available in every edition of Excel 2016 and later. SharePoint Folder exists only in Microsoft 365 Apps for enterprise and Office Professional Plus 2019.
How to use Power Query: a six-step monthly reporting tutorial
Six steps turn 12 monthly exports, a budget and a client list into a table of actuals, budget and variance. In order: connect the folder, clean one export, stack, unpivot, merge, load, checking the total at each step.
The company in our example is a fictional distributor. It sells three product categories, Tools, Paint and Electrical, and starts from three sources:
- Sales: one export per month from the order management software, in C:\Reporting\Sales, from sales-2025-01.xlsx to sales-2025-12.xlsx. Each export has two title rows and a Total row.
- Budget: a workbook, budget-2025.xlsx, one row per category, months in columns.
- Clients: a table named Clients in the reporting workbook (code, name, industry).
Each export holds only four sales, to fit on screen; the recipe works the same for four thousand. The figure to track: €260,200 of sales, from the first export to the final table.
The overall diagram fits in three columns.
Step 1: connect the folder
Data > Get Data > From File > From Folder, pick C:\Reporting\Sales, then Combine & Transform Data. In the Combine Files dialog, select the Export sheet of the first file, which serves as the sample.
Power Query sees the folder as a table of 12 rows, one per file. Two precautions right away:
- A parameter for the path: Home > Manage Parameters > New Parameter, named Folder, value C:\Reporting\Sales, to use instead of the path hard-coded in the query. If the folder moves, you change one value, not every query.
- A folder reserved for the exports, as Microsoft recommends: From Folder also reads subfolders. A filter on the name (“begins with sales-”) keeps out a stray file.
Step 2: clean one export
Three clicks on the first file, which will apply to the other eleven, each one recorded in the Applied Steps pane:
- Home > Remove Rows > Remove Top Rows, then enter 2: the title rows disappear.
- Home > Use First Row as Headers: columns Column1 to Column4 get their real names.
- Filter arrow on the Code column, clear the (null) check box: the Total row, which has no client code, is filtered out.
Clicking a step higher up shows the table at that point: the easiest way to see where a row disappears. Excel gives the steps longer default names (Removed Top Rows, Promoted Headers, Filtered Rows); right-click > Rename gives the short names in the picture.
The Total row deserves a closer look.
No message warns you about the doubling: only a check of the total reveals it.
Excel puts these clicks in a separate query, Transform Sample File, then applies them to each file through a function (fx icon). Work in that query, never in the function: edited directly, it would stop following the sample, Microsoft warns.
In the M language, this function comes down to four steps: reading the sheet, then one per click.
(file as binary) as table =>
let
Sheet = Excel.Workbook(
file){[Item = "Export",
Kind = "Sheet"]}[Data],
NoTitles = Table.Skip(
Sheet, 2),
Headers = Table.PromoteHeaders(
NoTitles,
[PromoteAllScalars = true]),
NoTotal = Table.SelectRows(
Headers,
each [Code] <> null)
in
NoTotalStep 3: stack the twelve months and set the data types
The stacking is already done: Power Query cleaned each file and put the results end to end. The 96 raw rows, 48 of them unwanted (per file: two title rows, the header row and the Total row), become 48 sales.
Next, set the data types: right-click the Date column header, select Change Type > Using Locale, then choose Date and the locale the file was written in, for example English (United Kingdom) for day-first dates. Do the same for the amount, with Decimal Number. With CSV files, this setting is what keeps 03/04, April 3 in a day-first file, from being read as March 4.
The habit to build: reconcile the total with a known figure. Here, €260,200 excl. VAT, the sum of the twelve Total rows; in practice, revenue from the trial balance.
Step 4: unpivot the budget
The budget is entered one month per column, while the sales have a Date column: unpivoting puts it in the same shape. Import the workbook, select the Category column, then Transform > Unpivot Columns > Unpivot Other Columns.
The two resulting columns are called Attribute and Value: rename them Month and Budget.
The table changes shape, not content.
Unpivot Other Columns also picks up columns added to the source later, Microsoft notes. All that is left is to turn the text “January” into a date, January 1, 2025, which no button does.
Rename the step that renamed the columns (Renamed Columns by default) to Renamed (right-click > Rename). In the Advanced Editor, add a comma at the end of that step, paste the step below after it, then replace Renamed with Dates after in:
Dates = Table.TransformColumns(
Renamed,
{{"Month",
each Date.FromText(
"1 " & _ & " 2025",
[Format = "d MMMM yyyy",
Culture = "en-US"]),
type date}})If your month headers are real dates (“Jan-25”), this step returns errors: replace the expression with Date.From(DateTime.FromText(_, [Culture = "en-US"])). Finish by setting Budget to Decimal Number.
Step 5: merge instead of using VLOOKUP
First the client, read from the Clients table by a Clients query. In the Sales query: Home > Merge Queries, choose Clients, click the Code column in both tables. Keep the Left Outer join: all sales, and the client when there is one.
Expand the new column with the icon in its header, check Client and Industry, and clear Use original column name as prefix, so the columns keep these names.
The client list has six clients; C007, created in December, is not in it yet. A VLOOKUP would have shown #N/A, often hidden by an IFERROR. Here, the €4,560 sale stays in the table and in the total, with an empty client (null) that tells you what to do: update the client list.
On the first merge, Excel may ask for the privacy level of the sources, a setting that decides whether data from one may be sent to the other: for two internal sources, give both the same level.
Then the budget. Merged directly into Sales, it would be copied onto every sale and counted several times, so you first roll the sales up to the budget’s level of detail: one category and one month. Right-click the Sales query > Reference (a new query that starts from the result of Sales), name the new query Actual, then add a custom column Month, Date.StartOfMonth([Date]), with the Date type.
In Actual, use Group By in Advanced mode: Category and Month, new column named Actual, operation Sum on Amount.
Last comes the Reporting query: right-click Budget > Reference, name the new query Reporting, then Merge Queries with Actual, on Category and then Month (Ctrl+click) in both tables. Expand the new column, check Actual and clear Use original column name as prefix, then add the custom column Variance, [Actual] - [Budget].
Reporting has 36 rows: €251,000 of budget, €260,200 of actuals, the same as in step 3. The join starts from the budget: a category sold outside the budget would be missing, hence this last check.
Step 6: load, then refresh every month
Home > Close & Load > Close & Load To…: the Reporting query goes to a table, the others to Only Create Connection. A pivot table gives the summary for the year:
| Category | Budget 2025 | Actual 2025 | Variance | Variance % |
|---|---|---|---|---|
| Tools | €114,000 | €122,260 | +€8,260 | +7.2% |
| Paint | €75,000 | €74,790 | −€210 | −0.3% |
| Electrical | €62,000 | €63,150 | +€1,150 | +1.9% |
| Total | €251,000 | €260,200 | +€9,200 | +3.7% |
The following month, drop the new export into the folder, then Data > Refresh All: every step runs again.
The M code was checked with Microsoft’s M parser, not run in Excel: try it on a copy of your files, adapting the names.
Which transformations will you use every day?
Ten commands from the Home, Transform and Add Column tabs are enough to clean most exports from an ERP, accounting system or bank; each becomes a step, replayed on every refresh.
The most common confusion is between the first two: appending queries and merging queries.
Stacking the folder in step 3 is an automatic append; the merge in step 5 replaces VLOOKUP.
| Transformation | Where to click | What it is for | Good to know |
|---|---|---|---|
| 1. Append Queries | Home > Append Queries | Put exports of the same kind end to end. | Columns are matched by name, not position; a missing column gets null. |
| 2. Merge Queries | Home > Merge Queries, then expand the column | Bring in the client or the budget. | A duplicate in the lookup table multiplies rows: recount. |
| 3. Conditional Column | Add Column > Conditional Column | An IF with no formula: tag a client “Key account” above a threshold. | Clauses are tested top to bottom; the new column has no data type: set one. |
| 4. Fill Down | Right-click the header > Fill > Down | Repeat a client written only on the first row of its group. | Only null cells are filled; turn blanks into null first. |
| 5. Split Column | Home > Split Column > By Delimiter | Split “C001 Dupont Co.” into code and name. | Left-most, right-most or each occurrence of the delimiter; into columns or rows. |
| 6. Replace Errors | Transform > Replace Values > Replace Errors | An “NA” in an amount column, which shows Error. | Look at the affected rows first (Keep Errors): a 0 can hide an anomaly. |
| 7. Remove Duplicates | Home > Remove Rows > Remove Duplicates | Clean a lookup table before merging it. | Case-sensitive; which occurrence is kept is not guaranteed. |
| 8. Group By | Home > Group By, Advanced for several columns | Roll invoices up to month and category. | Sum, average, median, min, max, count, or All Rows. |
| 9. Replace Values | Transform > Replace Values | Make “United Kingdom” and “UK” match. | The replacement also applies to the labels of later months. |
| 10. Column From Examples | Add Column > Column From Examples | Type the result you want: Power Query writes the formula. | It reads only the first 100 rows of the preview: check the rest. |
Locations apply to Excel for Windows and Power BI Desktop.
Copilot, the AI assistant built into Excel, also promises automatic data cleanup. For a monthly export, a query still has one advantage: written steps that can be reviewed and are replayed identically (Copilot in Excel).
The M language: do you need to know how to code?
You do not need to code to use Power Query: the editor writes one line of M per click, and Microsoft recommends letting it write most of the code. Being able to read it helps on the day a refresh fails.
The “Power Query M formula language” can be read step by step in the formula bar, and in full in the Advanced Editor. To learn, open it after each click. A query always has the same shape:
letopens the list of steps; each has a name and refers to the previous one.innames the step whose result is returned, usually the last one.- Case matters:
Table.Skipexists,table.skipdoes not.
let and in: each one starts from the result of the previous one.M or DAX? M prepares the data before it is loaded. DAX calculates the KPIs once the data is in a model, Power BI’s or Power Pivot’s (Excel’s Data Model): a year-to-date total, a comparison with last year (DAX in Power BI).
Power Query in Power BI: what changes?
Power BI Desktop contains the same Power Query as Excel, same editor and same M language; what changes is where the result goes, scheduled refresh, the number of connectors and sharing.
Close & Apply loads the result into the model, where you add relationships and DAX measures (Power BI data model). A new layout of the editor is in preview.
You can copy the code from one Advanced Editor to the other. Only the Clients query would change: it reads the workbook table with Excel.CurrentWorkbook, which is Excel-only.
| Topic | In Excel | In Power BI |
|---|---|---|
| Where the result goes | A worksheet, or the workbook’s Data Model. | A semantic model (Power BI’s name for a data model), published to the Power BI service, the website where reports are shared. |
| Refresh | On demand, on opening, or every n minutes while the workbook is open; nothing scheduled while it is closed. | Scheduled in the service, without opening any file. |
| Connectors | 40 in at least one version of Excel. | 215. |
| Platforms | Full on Windows, reduced on Mac and in the browser. | Authoring on Windows only; viewing in the browser. |
| Sharing and permissions | The workbook gets passed around: whoever opens it sees everything. | Permissions per person, data filtered by role if needed. |
| Dataflows | No; Excel can only read one. | Yes: preparation done once in the service, reused by several reports. |
Power BI also has Power Query Online, in the browser. Query folding, which hands filters and groupings off to a SQL database, works the same on both sides and does not apply to Excel or CSV files.
The whole tool is covered in our guide What is Power BI?
What mistakes should you avoid with Power Query?
Six mistakes keep coming back in small-business Power Query workbooks, and none of them triggers a message on the day you make it: the number is wrong, or the query breaks a month later.
- Types left to chance. Read with the computer’s regional settings, dates in a CSV from another country can end up in the wrong month. Set types with Using Locale, as Microsoft recommends for text files.
- Hard-coded paths. C:\Users\claire\Documents\Reporting only works on Claire’s computer. A parameter like Folder solves the problem.
- Renamed columns. If “Amount” becomes “Amount excl. VAT,” the type step stops with an error, which is better than a wrong number. Keep only the columns you need.
- Everything loaded to sheets. By default, a query lands in a worksheet, limited to 1,048,576 rows: load only the final result there.
- The catch-all folder. A copy named “sales-2025-03 (corrected).xlsx” or an Archive subfolder, and a month counts twice.
- Merging without recounting. A duplicate C002 in the client list doubles every sale for that client. After each merge, compare rows and total: 48 and €260,200, before and after.
Is Power Query in Excel enough, or should you move to Power BI?
Power Query in Excel is enough as long as one or two people read the report; Power BI is justified by the number of readers, hands-off refresh and access permissions, rarely by volume alone.
| Criterion | Excel is enough when… | Move to Power BI when… |
|---|---|---|
| Readers | One or two people build and read the report. | Several readers need to see the same number, without a file sent by email. |
| Refresh | Someone clicks Refresh All, every month or every week. | The report must be current every morning without anyone opening anything. |
| Volume | The result stays well under a million rows, or goes through the Data Model. | Millions of detail rows, on a computer that is already struggling. |
| History | The current year and the previous one. | Several years to compare, with a date table and measures. |
| Permissions | Every reader may see everything. | Each manager should see only their own scope. |
| Sources | Exports: Excel, CSV, a folder. | The accounting system, the ERP or the CRM, connected directly. |
| Cost | Nothing beyond the Excel license. | Power BI Desktop is free; €12.10 excl. VAT per month for each person who publishes or views (Pro license, Microsoft’s price for France), unless the company rents dedicated capacity (a Fabric F64 capacity or larger). |
Switch as soon as one of the situations on the right becomes a daily nuisance, most often the first or the second.
Whatever the tool, Power Query rereads the sources on every refresh: an export removed from the folder drops out of the report, so keep them all.
The official limits, in numbers
Power Query itself has no row limit: the limits that matter are Excel’s and Power BI’s, checked in Microsoft’s documentation on November 10, 2026.
| Limit | Value published by Microsoft |
|---|---|
| Query loaded to an Excel worksheet | 1,048,576 rows, 16,384 columns |
| Excel’s Data Model | 1,999,999,997 rows per table |
| Memory for a workbook with a Data Model | 32-bit Excel: 2 GB shared with Excel and its add-ins, about 1 GB for the Power Query engine when it has to sort data locally; 64-bit: the computer’s memory |
| Excel for the web | 250 MB for a workbook with a Data Model |
| Scheduled Power BI refreshes | 8 a day with Pro, 48 with Premium Per User (an individual license that costs more than Pro) or on a capacity (dedicated space rented by the company); at most 2 hours per refresh on shared capacity (the common space, Pro’s), 5 hours on Premium |
| Power BI model size | 1 GB with Pro; beyond that, Premium Per User (up to 100 GB) or a capacity |
These are ceilings, not comfort thresholds: slowness depends on the computer, and no published volume predicts it. On Power Query adoption or time saved, we found no reliable public statistics.
To decide, see the Power BI vs Excel grid and our comparison of Excel alternatives; for a report that goes out on its own, automated reporting; to learn, Power BI training.
Frequently asked questions
What is the difference between Power Query and Power Pivot?
Power Query imports, cleans and combines the data; Power Pivot then organizes it into a model: related tables and calculations written in DAX. In Excel, a query can load its result into this Data Model, on which you then build pivot tables.
How do I enable Power Pivot in Excel?
In Excel for Windows, go to File > Options > Add-ins, choose COM Add-ins in the Manage list, click Go, check Microsoft Power Pivot for Excel and click OK: the Power Pivot tab appears on the ribbon. Microsoft documents this for Excel for Microsoft 365, 2024 and 2021.
How do I add a column in Power Query?
Select Add Column > Custom Column, name the new column and write an M formula, for example [Quantity] * [Unit Price], then set its data type.
How do I write an IF statement in Power Query?
There is no IF function: use Add Column > Conditional Column, which needs no formula, or a custom column with the expression if [Amount] > 10000 then "Key account" else "Other". The keywords if, then and else are lowercase, and else is mandatory.
Where can I find a free Power Query course?
On Microsoft Learn: the “Clean, transform, and load data in Power BI” module (intermediate level), 10 units including an exercise, with no prerequisites. It is about Power BI, but the editor and the M language are the same as in Excel.
