Excel Power Query is the built-in tool (Data tab, Get & Transform Data) that imports data from files, folders and databases, cleans it with recorded steps, combines tables with Append or Merge, and reloads the result with one Refresh click. You build the clean-up once, then rerun it on every new file without touching formulas or macros.
Want the lookup side in more depth? Our XLOOKUP Excel tutorial with FILTER and SORT walks through each formula step by step.
Last updated: November 2026
Key takeaways
- Excel Power Query records every clean-up action as an Applied Step, so a messy monthly export is fixed by pressing Refresh All instead of repeating the work by hand.
- Append stacks tables with the same columns (three regional files become one list); Merge joins tables on a key, the way VLOOKUP or XLOOKUP would, but without formulas.
- Power Query is built into Excel 2016 and later under Data > Get Data, and is a free add-in for Excel 2010 and 2013.
- The Folder connector combines every file in a folder, so next month’s file is picked up automatically once you drop it in.
- Once data is clean, a ready-made report such as the Procurement Analysis Report in Excel ($6.99) gives you the dashboard layer, so you only build the data layer.
Launch offerClean messy monthly files with Power Query, combine a whole folder into one refreshable table, add a Data Model and MIS formulas, and build a one-click MIS report. 7h 16m of video by PK, with practice and solution files for every lesson.
Excel Power Query templates and shortcuts compared
Power Query cleans the data. These ready-made workbooks are what you point clean data at when you do not want to design the reporting side yourself.
| Template | Format | Best For | Price |
|---|---|---|---|
| Procurement Analysis Dashboard in Excel (Best overall) | Excel | Vendor, department and officer analysis of purchase data | $17.99 |
| Procurement Analysis Report in Excel (Best value) | Excel | Purchase orders, payments and supplier ratings | $6.99 |
| Pharmacy Workflow Bottleneck Analysis Report in Excel | Excel | Stage delays, urgency and repeat visits | $6.99 |
| Travel Expense Report Tracker in Excel | Excel + VBA | Travel expense records with approval workflow | $6.99 |
| Quality Analysis Dashboard in Power BI | Power BI | Defects, fatal errors and quality scores | $17.99 |
| Policy Performance and Risk Analysis Dashboard in Google Sheets | Google Sheets | Policies, premiums, claims and risk scores | $9.99 |
How we picked these shortcuts
This is a tutorial, so the steps come first and the templates are optional shortcuts. We looked for paid templates whose input is a flat table of records (orders, workflow stages, expenses, audits, policies), because that is exactly the shape Power Query produces. We left out anything without a clear data-entry sheet, and every price here is the live price on the product page.
What is Power Query in Excel and where do you find it?
Power Query is the data import and transformation engine inside Excel. It sits on the Data tab in the Get & Transform Data group. Excel 2016, 2019, 2021 and Microsoft 365 include it by default. Excel 2010 and 2013 on Windows need the free Microsoft add-in. Mac support has been added more slowly, so check your version.
Everything you click in the Power Query Editor is written as a line of M, the query language behind the tool. You rarely need to read it. The Applied Steps list on the right of the editor is the readable version: each step is one action, in order, and you can click any step to see the data as it looked at that moment.
The official reference is the Microsoft Power Query documentation, which lists every connector and transformation. This tutorial covers the 20% of it that handles most business clean-up jobs.
Why use Power Query instead of formulas and copy-paste?
Formulas work on data that is already in the sheet. Power Query works before that, on the raw file. The difference shows up in three places:
- Repeatability. A formula fix has to be dragged down again when the export has more rows. A query reruns on any number of rows.
- Source safety. The original file is never edited. Your query reads it and writes a separate output table.
- Volume. A worksheet holds 1,048,576 rows. A query can summarise a larger source before loading, which keeps the workbook small.
If you spend more than 30 minutes a month fixing the same export (deleting header rows, trimming spaces, fixing dates, stacking files), a query pays for itself in the second month.
How to use Power Query in Excel: the worked example
The steps below use one scenario so every action has a purpose. This is an illustrative example, not real company data. A procurement team receives a monthly purchase-order CSV from three regions (North, South, West). Each file has the same columns but a different title row, trailing spaces in supplier names, dates stored as text and costs stored as text with a dollar sign. A fourth file, a supplier master list, holds the supplier’s category and rating.
Say the three regional files have 412, 388 and 455 data rows. The goal is one clean table of 1,255 rows with a supplier category on each row, ready to chart.
Step 1: Put the files in one folder
Create a folder such as PO_Data and save the three regional files in it. Keep the supplier master list in a different folder, because it is a lookup table and should not be stacked with the orders. Folder discipline matters: the Folder connector reads everything inside, including a stray file someone drops in.
Step 2: Connect with Get Data from Folder
- Open a new workbook and go to Data > Get Data > From File > From Folder.
- Browse to PO_Data and click Open.
- In the preview window, choose Combine > Combine & Transform Data.
- Pick the sample file Excel should use to learn the layout (the first file is fine) and click OK.
Excel builds a helper query, a function and a sample query behind the scenes. You will see them in the Queries pane. Leave them alone. The output query, named after your folder, is the one you edit.
Step 3: Remove the junk rows and promote headers
Each regional file starts with a title line above the real headers. In the editor, choose Home > Remove Rows > Remove Top Rows and enter the number of junk lines. Then choose Use First Row as Headers. If you promote headers first, the title becomes your column name and every later step breaks, so the order matters.
Because the Folder connector applies your steps to the sample and then to every file, this fix is applied to all three regions at once. Also remove any repeated header rows that appear inside the data by filtering the first column to exclude the header text.
Step 4: Trim, clean and fix text
Select the Supplier column, then use Transform > Format > Trim to strip leading and trailing spaces, and Transform > Format > Clean to remove non-printing characters. Apply Capitalize Each Word or UPPERCASE if the same supplier appears in several cases. Power Query comparisons are case-sensitive, so this step decides whether a later Merge matches.
Use Replace Values for known typos, for example changing “Acme Ltd.” to “Acme Ltd”. To fix many variants of one value, do it once here rather than in the report.
Step 5: Set the right data types
Click the icon at the left of each column header and choose the type. Dates become Date, quantities become Whole Number and costs become Fixed Decimal Number or Currency. For costs stored as text with a dollar sign, first use Replace Values to remove the “$” and commas, then change the type.
If dates come in a different regional format from your computer’s, use Change Type > Using Locale and choose the locale of the source. This single option fixes most of the day/month swap problems people report with Excel Power Query.
Step 6: Handle nulls, errors and duplicates
- Use Remove Rows > Remove Errors to drop rows that failed a type conversion, or Keep Errors first to see what failed.
- Use Replace Values to turn null in a text column into “Unknown”.
- Select the PO Number column and choose Remove Rows > Remove Duplicates if the same order appears in two files.
Look at the row count in the status bar before and after. If 1,255 rows becomes 1,100, find out why before trusting the output.
Step 7: Unpivot columns if the data is in a crosstab
Some exports have one column per month (Jan, Feb, Mar). Charts and PivotTables need one Month column and one Value column. Select the identifier columns (Supplier, Region), right-click and choose Unpivot Other Columns. Four month columns for 100 suppliers become 400 rows with an Attribute and a Value column. Rename them Month and Amount.
Step 8: Merge with the supplier master list
- Load the supplier master as its own query: Data > Get Data > From File > From Workbook, then Transform Data.
- Trim and clean the Supplier column in that query too.
- Return to the orders query and choose Home > Merge Queries > Merge Queries.
- Select the Supplier column in both tables.
- Choose the join kind. Left Outer keeps all orders and adds matches. Use it as the default.
- Click the expand icon on the new column and tick only the fields you need, such as Category and Rating. Untick “Use original column name as prefix” if you want clean headings.
After the merge, filter the Category column for null. Those rows are suppliers missing from the master list. That is a data-quality finding worth fixing at the source.
Step 9: Append instead of Merge when stacking tables
If you did not use the Folder connector, stack tables with Home > Append Queries. Choose Two tables or Three or more tables and add each query. Columns are matched by name, not position. A column that exists in only one table will be filled with null in the rest, so a renamed column such as “Cost” versus “Total Cost” shows up as two columns. Rename them to match before appending.
Step 10: Load the result and refresh
- Choose Home > Close & Load To.
- Pick Table to land it on a sheet, or Only Create Connection if it will feed a PivotTable or the Data Model.
- Next month, drop the new files in the folder and choose Data > Refresh All.
The load step is also the place to decide whether the result goes to the Data Model. Tick “Add this data to the Data Model” if you plan to build relationships or DAX measures. Otherwise a plain table keeps the file simpler.
How do you combine data from multiple Excel files with Power Query?
For files with the same layout, use From Folder and Combine & Transform, as in step 2. For a handful of different workbooks, load each as its own query and use Append (same columns) or Merge (shared key). Where each workbook has several sheets or tables, the Combine step lets you pick the sheet name from the sample file.
A practical rule: use Folder when the file count grows, Append when it is fixed and small, and Merge when you are adding columns rather than rows. Mixing the two up is the most common reason a combined table has the wrong row count.
| Goal | Use | Row count result |
|---|---|---|
| Stack 12 monthly files with identical columns | From Folder, Combine & Transform | Sum of all rows |
| Stack 2 or 3 named tables | Append Queries | Sum of all rows |
| Add supplier category to every order | Merge Queries, Left Outer | Same as orders table (if the master has no duplicate keys) |
| Find orders with no supplier on file | Merge Queries, Left Anti | Only unmatched orders |
| Keep only matches | Merge Queries, Inner | Only matched rows |
What are the most common Power Query errors and how do you fix them?
| Error or symptom | Usual cause | Fix |
|---|---|---|
| Expression.Error: The column ‘X’ of the table wasn’t found | Source column was renamed or removed | Delete the Changed Type step, or edit the step that names the column |
| DataFormat.Error: We couldn’t convert to Number | Text such as “N/A” or “$1,200” in a number column | Replace Values first, then change type; or Replace Errors |
| Merge returns nulls for rows that should match | Trailing spaces or different case in the key | Trim and Clean both key columns, match case |
| Row count rises after a Merge | Duplicate keys in the lookup table | Remove Duplicates on the lookup key before merging |
| Dates swap day and month | Source locale differs from your computer | Change Type > Using Locale |
| Folder query fails on a new file | Stray file or different layout in the folder | Filter the File Name or Extension column in the first step |
| Refresh says file path not found | Workbook moved to another machine or drive | Home > Data Source Settings, or use a parameter for the folder path |
| Formulas next to the output table break | Refresh changed the table size | Reference the table by structured name, not by cell range |
| Refresh is very slow | Many steps run before a filter | Move row filters and Remove Columns to the earliest steps |
Which Excel template can I point cleaned data at?
Once Power Query gives you a tidy table, the report layer is the part many people skip because building charts takes longer than cleaning. These templates already have the layout. You paste or load your cleaned records into the data sheet and the pages update.
Procurement data: dashboard or report
If your example looks like the purchase-order scenario above, the Procurement Analysis Dashboard in Excel ($17.99) is the fuller option. It covers an overview page, vendor and item analysis, departmental procurement, officer performance and location analysis, with a data input sheet that refreshes the dashboard. The cheaper Procurement Analysis Report in Excel ($6.99) has a summary tab with cards for Total Orders, Total Cost, Quantity Ordered, Average Rating and Average Total Cost, plus charts for payment completion and overdue payments.
Shortcut: Clean your purchase-order table with the steps above, then load it into the Procurement Analysis Report in Excel for $6.99. See the Procurement Analysis Report. Best for finance managers who want order, cost and payment status in one sheet.
Best overall for procurement: the Procurement Analysis Dashboard in Excel at $17.99 adds vendor, department, officer and location views. View the procurement dashboard.
Workflow and operations data
Operational exports tend to arrive as one row per event, with stage, duration and status fields. The Pharmacy Workflow Bottleneck Analysis Report in Excel ($6.99) has a data sheet that captures Workflow ID, drug category, stage, duration and delay, urgency level, completion and approval status and repeat visit tracking, and feeds charts and pivot tables from it. The same cleaning pattern applies to any stage-based log. For more healthcare-specific options, see our healthcare and hospital management templates.
Shortcut: $6.99 for a workflow report with a performance dashboard and pivot table reports. Get the pharmacy workflow report.
Expense data from many people
Expense files are the classic messy source: different people, different currencies, different date styles. If you would rather control entry than clean afterwards, the Travel Expense Report Tracker in Excel ($6.99) uses dropdown-driven entries and Add, Update and Delete buttons, and covers currency and duration tracking. It is an Excel and VBA tracker with role-based login. Our guide to travel and expense tracking dashboards compares the formats.
Shortcut: $6.99 prevents bad entries at the source. See the travel expense tracker.
Quality and insurance data in other formats
Power Query also exists inside Power BI, and the same Applied Steps logic carries over. If your cleaned data is audit or defect data, the Quality Analysis Dashboard in Power BI ($17.99) tracks tasks, defects, fatal errors and quality scores by supervisor, location, auditor and employee. If your team lives in Google Sheets, the Policy Performance and Risk Analysis Dashboard in Google Sheets ($9.99) has five analysis pages with slicers for insurance type, status, risk category, region and agent. See also why a quality KPI dashboard matters.
Shortcut: $17.99 for a Power BI quality dashboard. Get the quality dashboard in Power BI.
Shortcut: $9.99 for a Google Sheets insurance dashboard. See the policy dashboard.
How do you turn cleaned Power Query data into a PivotTable dashboard?
Load the query to the Data Model or a table, click inside it and choose Insert > PivotTable. Because the source is a query table, every Refresh All updates the PivotTable too. Our step-by-step Excel PivotTable dashboard tutorial covers slicers and charts. For sales data specifically, compare the best sales dashboard templates, and for people data see which HR dashboard format fits your team. Compliance teams can look at these legal compliance dashboards.
How do you decide when to use Power Query, formulas or a macro?
- The raw file changes every week or month and needs the same fixes: Power Query.
- The data is already clean and you need a calculated column inside the sheet: a formula.
- You need a button, a form or user-level actions inside the workbook: VBA, as in the travel expense tracker above.
- You are combining millions of rows or need scheduled refresh for a team: consider Power BI or a database.
When is Power Query NOT the right answer?
Power Query is not the right tool in a few honest cases:
- One-off clean-up. If you will never see the file again, Find and Replace and Text to Columns take less time than building a query.
- Row-by-row judgement. If each record needs a human decision, the work belongs in a form or tracker, not a query.
- Shared workbooks with locked-down security. Queries that read network folders or databases need credentials and privacy-level settings, and colleagues without access will see refresh errors.
- Very large or live data. Millions of rows refreshed every hour belong in a database and a BI tool such as Power BI, not a desktop Excel file.
- Mac-only teams on older Excel. Feature coverage varies by version, so test before you design a process around it.
If your problem is that data is entered badly in the first place, fix the entry point. A template with dropdown lists and a defined data sheet prevents half the clean-up that Power Query would otherwise do.
Frequently asked questions
Is Power Query free in Excel?
Yes. Power Query is included at no extra cost in Excel 2016, 2019, 2021 and Microsoft 365 under Data > Get Data. Excel 2010 and 2013 for Windows can use it as a free downloadable add-in from Microsoft. You only pay for Excel itself, not for the query tool.
How do I use Power Query in Excel for beginners?
Go to Data > Get Data, pick your source (workbook, CSV or folder), and click Transform Data. In the editor, remove top rows, promote headers, trim text and set data types. Then choose Close & Load. Next time, press Refresh All and every step reruns on the new data.
What is the difference between Append and Merge in Power Query?
Append stacks tables on top of each other, adding rows, and matches columns by name. Merge joins two tables side by side on a key column, adding columns, like a lookup. Use Append for monthly files with identical headings and Merge to bring in categories or ratings from a master list.
Why does my Power Query merge return null values?
The most common cause is a key mismatch: extra spaces, different capitalisation or different data types (text versus number). Trim and Clean both key columns, set the same type on both and use consistent case. Then check whether the value truly exists in the lookup table.
Can Power Query combine multiple Excel files automatically?
Yes. Use Data > Get Data > From File > From Folder, then Combine & Transform Data. Excel applies the same steps to every file in the folder. When you add next month’s file to the folder and click Refresh All, it is included without editing the query.
Does Power Query change my original data?
No. Power Query reads the source and writes the results to a new table or connection. The original file, sheet or CSV is left exactly as it was. If you delete the query, the source is unaffected. This is the main reason it is safer than manual clean-up.
Why is my Power Query refresh so slow?
Slow refresh usually comes from loading every column and row before filtering. Remove unused columns and filter rows in the earliest steps, avoid repeated merges on large tables and turn off loading for staging queries. Large folders with many files also slow the Folder connector.
What is the difference between Power Query in Excel and Power BI?
The Power Query Editor and the M language are essentially the same in both. In Excel the output lands in a worksheet or Data Model. In Power BI it feeds a report with visuals and scheduled refresh in the service. Queries can often be copied between the two.
Do I need to learn M code to use Power Query?
No. Most tasks are done with buttons, and the editor writes the M code for you. Learning M becomes useful for custom columns, conditional logic and parameters. You can start without it and read the Advanced Editor view later to see what each step does.
Get more Excel templates for cleaned data
Best value: the Procurement Analysis Report in Excel is $6.99, and the fuller Procurement Analysis Dashboard in Excel is $17.99. Clean the data with Power Query, then drop it in.
Watch walkthroughs on the NextGenTemplates YouTube channel.






