10 Excel Power Query Transformations That Eliminate Manual Data Cleaning
You download a data export. It's a mess: merged headers, inconsistent dates, blank rows, text that should be numbers, and columns you don't need. You spend 2 hours manually fixing it before you can even start analysis.
Tomorrow, you'll download another export. And spend another 2 hours doing the same cleanup.
Power Query changes that equation. Build the cleanup process once, click "Refresh," and your data is instantly cleaned—every time. Those 2 hours become 30 seconds.
This guide teaches you 10 Power Query transformations that handle 90% of real-world data cleaning challenges.
What is Power Query and Why Use It?
Power Query = Excel's data transformation and preparation tool (Get & Transform Data).
Why it's transformative:
- Reproducible: Build cleanup steps once, reuse forever
- Non-destructive: Original data stays intact
- Automatic: Refresh to apply all steps to new data
- Visual: See transformations in real-time
- Fast: Handles millions of rows efficiently
Available in: Excel 2016+, Excel Online (Microsoft 365)
Common misconception: "Power Query is for advanced users"
Reality: Basic transformations are easier than manual cleanup
Getting Started: Access Power Query
Method 1: From Data Tab
- Data tab → Get Data → From File/Other Sources
- Navigate to your data source
- Power Query Editor opens
Method 2: Convert Existing Data
- Select data range in Excel
- Data tab → From Table/Range
- Data loads into Power Query Editor
Method 3: Existing Query
- Data tab → Queries & Connections
- Right-click query → Edit
Power Query Editor Interface:
- Left: Applied Steps (your transformation recipe)
- Center: Data preview
- Right: Query Settings
- Top: Transform ribbon (all available transformations)
Transformation 1: Remove Blank Rows
Problem: Exported data has blank rows scattered throughout, breaking formulas and pivot tables.
Manual method: Filter, delete blanks, un-filter (tedious, error-prone)
Power Query solution:
Step 1: Home tab → Remove Rows → Remove Blank Rows
Done. Every blank row gone instantly.
Advanced option: Remove rows where specific column is blank:
- Click column header
- Home tab → Remove Rows → Remove Blanks
Pro tip: This step automatically updates when data refreshes, even if blank rows are in different positions.
Use case: Any data export that includes blank rows for readability.
Transformation 2: Promote Headers
Problem: First row contains data, not column headers. Or headers are in row 3 after title rows.
Before:
| Column1 | Column2 | Column3 |
|---|---|---|
| Name | Sales | Region |
| John | 5000 | East |
| Sarah | 7500 | West |
Solution:
Home tab → Use First Row as Headers
Result: "Name", "Sales", "Region" become column headers, data rows start from John.
If headers are in row 3:
- Home tab → Remove Top Rows → Enter "2"
- Then: Use First Row as Headers
Use case: Reports with title rows or exports without proper headers.
Transformation 3: Unpivot Columns (Convert Wide to Long Format)
Problem: Data in wide format (months as columns) needs to be in long format for pivot tables or analysis.
Before (Wide):
| Product | Jan | Feb | Mar |
|---|---|---|---|
| Widget | 100 | 120 | 115 |
| Gadget | 200 | 190 | 210 |
After (Long):
| Product | Month | Sales |
|---|---|---|
| Widget | Jan | 100 |
| Widget | Feb | 120 |
| Widget | Mar | 115 |
| Gadget | Jan | 200 |
| Gadget | Feb | 190 |
| Gadget | Mar | 210 |
Solution:
- Select the identifier column (Product)
- Transform tab → Unpivot Columns → Unpivot Other Columns
- Rename columns: "Attribute" → "Month", "Value" → "Sales"
Why this matters: Pivot tables and charts work better with long format. Unpivot transforms data structure in seconds instead of hours of manual work.
Use case: Monthly reports, survey data with multiple choice columns, any wide-format data.
Transformation 4: Split Columns by Delimiter
Problem: One column contains multiple pieces of information separated by comma, space, or other delimiter.
Example:
| Full Name | |
|---|---|
| John Smith | john@example.com |
| Sarah Johnson | sarah@example.com |
Want: Separate First Name and Last Name columns.
Solution:
- Click "Full Name" column
- Transform tab → Split Column → By Delimiter
- Select delimiter: Space
- Choose: "At the left-most delimiter" (splits only once)
- Rename columns: "Full Name.1" → "First Name", "Full Name.2" → "Last Name"
Advanced options:
- Split by number of characters
- Split by positions
- Split at each occurrence (creates multiple columns)
Common delimiters:
- Space: Names ("John Smith")
- Comma: CSV data ("North, East, West")
- Hyphen: SKUs ("PROD-12345-ABC")
- Custom: Any character you specify
Use case: Separating full names, parsing product codes, splitting addresses.
Transformation 5: Merge Columns
Problem: Opposite of splitting—need to combine multiple columns into one.
Example:
| First Name | Last Name | Email Domain |
|---|---|---|
| John | Smith | example.com |
Want: Full Name and Full Email columns.
Solution for Full Name:
- Select "First Name" column
- Ctrl+Click "Last Name" column (both selected)
- Transform tab → Merge Columns
- Separator: Space
- New column name: "Full Name"
For Full Email (formula approach):
- Add Column tab → Custom Column
- Formula:
[First Name] & "." & [Last Name] & "@" & [Email Domain] - Name: "Full Email"
- Result: john.smith@example.com
Use case: Creating full names, building email addresses, concatenating IDs.
Transformation 6: Change Data Types
Problem: Numbers stored as text, dates not recognized, currency symbols preventing calculations.
Symptoms:
- Sums return 0
- Sorts alphabetically instead of numerically
- Dates won't work in date calculations
Solution:
- Click column header
- Note icon showing current data type
- Transform tab → Data Type → Select correct type
Common type changes:
- Text → Whole Number: Sales data imported as text
- Text → Decimal Number: Numbers with decimals
- Text → Date: Dates stored as text ("2026-01-15")
- Number → Currency: Add currency formatting
- Text → Percentage: Convert percentages
Auto-detect types:
- Home tab → Detect Data Type (Power Query guesses based on values)
Use case: Any imported data where types aren't automatically detected correctly.
Transformation 7: Replace Values
Problem: Inconsistent data entry—"North", "N", "NORTH" should all be "North". Or need to clean up codes, fix typos, standardize formats.
Solution:
- Click column
- Transform tab → Replace Values
- Value to Find: "N"
- Replace With: "North"
- Repeat for other variations
Replace multiple values at once:
- Add Column tab → Conditional Column
- Or use: Transform tab → Replace Values (manual, one at a time)
Better approach for multiple replacements:
- Create reference table with old value → new value mappings
- Merge query with reference table (covered in Transformation 10)
Advanced: Replace null/blank with specific value:
- Home tab → Replace Values
- Leave "Value to Find" blank
- Enter replacement value
Use case: Standardizing categories, fixing typos, cleaning up data entry inconsistencies.
Transformation 8: Filter Rows
Problem: Dataset includes rows you don't need for analysis (test data, inactive accounts, specific date ranges).
Solution:
Basic filter:
- Click dropdown on column header
- Uncheck values to exclude
- Click OK
Advanced filters:
- Click dropdown → Text Filters / Number Filters / Date Filters
- Choose condition:
- Contains / Does Not Contain
- Greater Than / Less Than
- Between (for numbers and dates)
- Begins With / Ends With
Multiple filter conditions:
- Each filter adds a step
- All conditions must be true (AND logic)
- For OR logic: use filter column → "OR" multiple values
Remove filter:
- Delete the "Filtered Rows" step from Applied Steps
Best practice: Filter early in transformation sequence to reduce data processing time.
Use case: Removing test records, focusing on specific date range, excluding cancelled orders.
Transformation 9: Add Custom Columns with Formulas
Problem: Need calculated column based on existing data—percentage change, age from birthdate, categorization logic.
Solution:
- Add Column tab → Custom Column
- Enter formula using M language (Power Query formula language)
- Click OK
Example 1: Calculate percentage change:
1Column Name: Percent Change2Formula: ([Current Year Sales] - [Prior Year Sales]) / [Prior Year Sales]
Example 2: Categorize by value:
1Column Name: Sales Category2Formula:3if [Sales] > 10000 then "High"4else if [Sales] > 5000 then "Medium"5else "Low"
Example 3: Extract year from date:
1Column Name: Year2Formula: Date.Year([Order Date])
Example 4: Combine conditions:
1Column Name: Status2Formula:3if [Amount] > 1000 and [Region] = "North" then "Priority"4else "Standard"
Common M functions:
Text.Upper(),Text.Lower(),Text.Proper()- Change caseText.Length()- Count charactersDate.Year(),Date.Month(),Date.Day()- Extract date partsNumber.Round()- Round numbersText.Contains()- Check if text contains substring
Pro tip: Click "Insert Column" in formula dialog to reference existing columns—prevents typos.
Use case: Any calculation or logic that would normally require Excel formulas.
Transformation 10: Merge Queries (VLOOKUP Alternative)
Problem: Need to combine data from two tables—like VLOOKUP but more powerful and automatic.
Example: Orders table + Customers table. Want to add customer details to orders.
Solution:
Step 1: Load both tables into Power Query
- Orders query
- Customers query
Step 2: Merge queries:
- Open Orders query
- Home tab → Merge Queries → Merge Queries (not Merge Queries as New)
- Select join column in Orders (e.g., Customer ID)
- Select Customers query from dropdown
- Select matching column in Customers (Customer ID)
- Join Kind: Left Outer (keeps all Orders, adds matching Customers)
- Click OK
Step 3: Expand merged column:
- Click expand icon in merged column header
- Select which columns to add (Customer Name, Region, etc.)
- Uncheck "Use original column name as prefix" (optional)
- Click OK
Result: Orders table now has Customer Name, Region, etc. from Customers table.
Join types explained:
- Left Outer: Keep all rows from first table, add matching from second
- Inner: Only rows that match in both tables
- Right Outer: Keep all from second, add matching from first
- Full Outer: Keep all rows from both tables
- Left Anti: Rows in first table WITHOUT match in second
Use case: Replace all VLOOKUPs, combine data from multiple sources, add reference data.
Bonus Transformation 11: Remove Duplicates
Problem: Dataset has duplicate rows that skew analysis.
Solution:
Remove complete duplicate rows:
Home tab → Remove Rows → Remove Duplicates
Keep only first occurrence based on specific column:
- Click column to check for duplicates (e.g., Customer ID)
- Home tab → Remove Rows → Remove Duplicates
Keep last occurrence (not first):
- Home tab → Sort Descending (on date or relevant column)
- Remove Duplicates
- Sort back to original order if needed
Identify duplicates (don't remove):
- Group by relevant columns
- Add aggregation: Count rows
- Filter where count > 1
Use case: Cleaning customer lists, removing repeated transactions, finding duplicate entries.
Real-World Workflow: Putting It All Together
Scenario: Monthly sales report from outdated system
Data issues:
- 3 title rows before headers
- Blank rows between sections
- Sales column stored as text with "$" symbols
- Dates in MM/DD/YYYY text format
- Region column has inconsistent values ("North", "N", "NORTH")
- Need to add Product Category from separate lookup table
Power Query solution (10 steps, once):
1. Remove Top 3 Rows (Remove Rows → Remove Top Rows → 3) 2. Use First Row as Headers 3. Remove Blank Rows 4. Replace Values in Region: "N" → "North", "NORTH" → "North" 5. Remove "$" from Sales: Replace Values "$" with "" (blank) 6. Change Sales Type: Text → Currency 7. Change Date Type: Text → Date 8. Merge Query with Product Lookup table on Product ID 9. Expand to add Product Category column 10. Remove Product ID column (no longer needed)
Time to build: 10 minutes
Time to run every month: 5 seconds (just click Refresh)
Time saved monthly: 2 hours → 5 seconds = 1.99 hours
Annual savings: 24 hours of manual data cleaning eliminated.
Power Query Best Practices
1. Name Your Steps Clearly
Default: "Changed Type", "Filtered Rows"
Better: "Convert Sales to Currency", "Remove Test Orders"
How: Right-click step → Rename
Why: Makes troubleshooting easier months later
2. Document Complex Steps
How: Right-click step → Properties → Description
Example: "Merged with Product table to add categories. Left join keeps all sales even if product not in lookup."
3. Use Query Reference, Not Duplicate
Wrong: Copy entire query for slight variation
Right: Right-click query → Reference → Modify only what's different
Why: Changes to source query automatically flow to referenced queries
4. Group Related Queries
How: Right-click blank space → New Group → Name it
Example groups:
- "Source Queries" (raw data loads)
- "Transformation Queries" (cleaning steps)
- "Output Queries" (final tables for reports)
5. Refresh Preview Data Regularly
How: Home tab → Query → Edit
Why: Catches errors early when building transformations
6. Load Only Final Queries to Workbook
How: Right-click intermediate query → Enable Load → Uncheck
Why: Keeps workbook clean, only shows end results
Troubleshooting Common Power Query Errors
Error: "Expression.Error: The column 'Sales' doesn't exist"
Cause: Column was renamed earlier, later step still references old name
Fix: Click step where error occurs → Edit formula → Update column name
Error: "DataFormat.Error: We couldn't convert to Number"
Cause: Non-numeric characters in column you're converting to number
Fix: Add Replace Values step first to remove symbols ($, commas, etc.)
Error: Query refreshes slowly
Cause: Too much data, inefficient steps, or loading intermediate queries
Fix:
- Filter data early (reduces rows to process)
- Remove columns you don't need early
- Disable loading of intermediate queries
- Use Query Folding when possible (push work to source system)
"Circular Reference" Error
Cause: Query references itself directly or indirectly
Fix: Redesign logic using buffering or split into separate queries
Advanced Tips
Tip 1: Use Parameters for Flexible Queries
Create parameter:
- Home tab → Manage Parameters → New Parameter
- Name: "Report Year", Type: Number, Default: 2026
Use in query:
1Filter: [Year] = Report_Year
Update: Change parameter → All queries using it update automatically
Tip 2: Create Reusable Functions
Example: Cleanup function for phone numbers
1(InputNumber as text) as text =>2let3 Remove_Spaces = Text.Remove(InputNumber, " "),4 Remove_Dashes = Text.Remove(Remove_Spaces, "-"),5 Remove_Parens = Text.Remove(Remove_Dashes, {"(",")"})6in7 Remove_Parens
Apply: Invoke Custom Function on any phone number column
Tip 3: Use Query Dependencies View
How: View tab → Query Dependencies
Shows: Visual map of how queries connect
Use for: Understanding complex workbook, finding circular references
Frequently Asked Questions
Does Power Query change my original data?
No. Power Query is non-destructive. Original data stays intact. Results load to new table or existing table you specify.
Can I undo steps in Power Query?
Yes. Delete steps from Applied Steps pane. Or close without saving. Original data unchanged.
What's the difference between Power Query and Power Pivot?
Power Query: Data cleaning, transformation, shaping (ETL)
Power Pivot: Data modeling, relationships, DAX calculations (Analysis)
Often used together: Query cleans, Pivot analyzes.
Can Power Query connect to databases?
Yes. Get Data → From Database → SQL Server, MySQL, Oracle, etc.
Transform data before loading to Excel (reduces Excel file size).
Is Power Query available in Excel Online?
Yes, but with limitations. Desktop Excel has full functionality.
Does Power Query work with Mac Excel?
Yes, starting Excel 2016 for Mac. Some features differ from Windows version.
How often should I refresh queries?
Depends on data:
- Static data: Manual refresh when source updates
- Regular reports: Set up automatic refresh (Data → Queries → Properties → Refresh Options)
Practice Exercises
Exercise 1: Basic Cleaning
Data: Download sample messy data (create with blank rows, mixed types)
Tasks:
- Remove blank rows
- Promote headers
- Change data types
- Remove duplicates
Time goal: 5 minutes
Exercise 2: Reshaping
Data: Sales by month in wide format
Tasks:
- Unpivot month columns
- Rename columns
- Change date format
- Sort by date
Time goal: 7 minutes
Exercise 3: Merging
Data: Orders table + Customers table
Tasks:
- Load both tables
- Merge on Customer ID
- Expand customer details
- Remove unnecessary columns
Time goal: 10 minutes
Conclusion
These 10 Power Query transformations eliminate 90% of manual Excel data cleaning:
- ✅ Remove blank rows
- ✅ Promote headers
- ✅ Unpivot columns (wide to long)
- ✅ Split columns by delimiter
- ✅ Merge columns
- ✅ Change data types
- ✅ Replace values
- ✅ Filter rows
- ✅ Add custom columns
- ✅ Merge queries (VLOOKUP++)
The transformation: 2 hours of monthly manual work → 5 seconds of clicking "Refresh"
Start this week:
- Identify one report you clean manually every month
- Build Power Query transformation for it (invest 15-30 minutes)
- Next month: Refresh instead of re-cleaning (save 2 hours)
- Multiply that across all your recurring reports
Power Query isn't about learning complex programming—it's about investing 30 minutes once to save 2 hours forever.
Related articles: Excel Power Query Data Transformations Guide, Power Query 101: Clean Messy Data
Sponsored Content
Interested in advertising? Reach automation professionals through our platform.
