If you're still manually cleaning and reshaping data every week or month, Power Query will change your life. It's a built-in ETL (Extract, Transform, Load) tool in Excel that lets you automate repetitive data preparation — once you set it up, it runs with a single click.
What Is Power Query?
Power Query (found under the Data tab as "Get & Transform Data") is a data connection and transformation engine. It can:
- Import data from files, databases, web pages, APIs, and more
- Clean and reshape data with a visual, step-by-step interface
- Merge and append data from multiple sources
- Automate the entire process — refresh with one click
Getting Started
Importing Data
Go to Data → Get Data. You can import from:
- Files — Excel, CSV, XML, JSON, PDF, and more
- Databases — SQL Server, Access, MySQL, PostgreSQL
- Online — SharePoint, web pages, OData feeds
- Other — Folder (import all files in a folder), ODBC connections
The Power Query Editor
When you import data, the Power Query Editor opens. This is where you build your transformation steps. Every action you take is recorded as a step that can be replayed:
- Remove unwanted columns
- Filter rows
- Change data types
- Split or merge columns
- Add calculated columns
- Pivot or unpivot data
- Group and aggregate
Practical Example: Monthly Sales Report
Suppose you receive a CSV sales report every month and need to clean it the same way each time:
- Go to Data → From Text/CSV, select your file
- In Power Query Editor, apply your cleaning steps:
- Remove the first 3 header rows
- Promote the 4th row to headers
- Remove blank rows
- Change "Revenue" column to currency type
- Add a "Month" column extracted from the date
- Click Close & Load to load the clean data into your worksheet
Next month, simply replace the CSV file and click Data → Refresh All. All your cleaning steps run automatically on the new data.
Key Transformations
| Transformation | Where to Find It | Use Case |
|---|---|---|
| Remove Columns | Right-click column header | Drop unnecessary fields |
| Filter Rows | Dropdown on column header | Remove blanks, specific values |
| Split Column | Transform → Split Column | Separate "City, State" into two columns |
| Unpivot | Transform → Unpivot Columns | Convert wide tables to tall format |
| Merge Queries | Home → Merge Queries | JOIN two tables (like VLOOKUP but better) |
| Append Queries | Home → Append Queries | Stack tables on top of each other |
| Group By | Transform → Group By | Aggregate data (sum, count, average) |
Merging Data from Multiple Sources
Power Query's Merge feature is like a database JOIN. Import two tables, then:
- Go to Home → Merge Queries
- Select the matching columns from each table
- Choose the join type (Left, Right, Inner, Full, Anti)
- Expand the columns you want from the second table
This is far more reliable than VLOOKUP for large datasets and multiple match columns.
Importing All Files from a Folder
One of Power Query's killer features. If you have monthly reports in a folder:
- Data → Get Data → From File → From Folder
- Select the folder
- Power Query shows all files — click "Combine & Transform"
- Apply your cleaning steps once — they apply to every file
- When you add new files to the folder, just click Refresh
When to Use Power Query vs Formulas
- Power Query: Recurring data imports, multi-source data, complex reshaping, large datasets
- Formulas: One-time calculations, real-time updates as you type, simple transformations
Power Query is a preparation tool — it gets your data ready. Formulas and pivot tables are analysis tools — they help you understand the prepared data.
Want to master Excel with AI?
My upcoming Complete Excel Guide with AI Integration course covers everything from formulas to AI-powered workflows.
Explore Courses