Power Query: Data Cleaning, How to Remove Errors, Duplicates, Rows & Columns
- Fakhriddinbek
- Aug 21
- 4 min read
Updated: Aug 31
If you’ve ever opened a dataset and felt overwhelmed by blank rows, duplicate entries, or cryptic error messages, you’re not alone. Raw data is rarely clean—and that’s exactly why Power Query exists.
In this tutorial, you’ll learn how to remove unnecessary rows and columns, eliminate duplicates, and handle error data in Power Query. Whether you're working in Excel or Power BI, these techniques will help you transform chaos into clarity.
Why Data Cleaning Is Non-Negotiable
Before you build dashboards or run calculations, your data needs to be clean. Here's why:
Errors break formulas and visuals
Blank rows and columns slow performance
Duplicates distort totals and averages
Irrelevant data leads to misleading insights
Think of Power Query as your data detox tool—cleansing your dataset so it’s lean, accurate, and analysis-ready.
What You’ll Learn to Remove
Type of Data Issue | Description | Example |
Blank Rows | Rows with no meaningful data | All columns empty |
Unnecessary Columns | Columns not needed for analysis | “Notes”, “Timestamp”, etc. |
Duplicate Rows | Repeated entries that skew results | Same customer listed twice |
Error Values | Invalid data due to failed transformations | #ERROR, Expression.Error |

Removing Unnecessary Rows
Remove Blank Rows
To remove rows where all columns are blank:
Go to Home → Remove Rows → Remove Blank Rows
Or filter out rows where key columns are null
Use filters to target specific columns if only partial blanks matter.
Remove Top or Bottom Rows
Imported files often include headers, footers, or notes. To remove them:
Use Home → Remove Rows → Remove Top Rows or Remove Bottom Rows
Specify the number of rows to skip
Example:
Table.Skip(Source, 2)
Preview your data to identify which rows are non-essential.

Removing Unnecessary Columns
Columns like “Year2”, “Estimate2”, or “Year3” may not be relevant to your analysis.
How to Remove Columns
Select the columns you want to keep
Go to Home → Remove Columns → Remove Other Columns
Or select unwanted columns and choose Remove Columns
Example:
Table.RemoveColumns(Source, {"Estimate", "Year2", "Estimate3", "Year4"})
Keep only the columns that drive insights.

Removing Duplicate Rows
Duplicates can inflate totals or distort averages.
How to Remove Duplicates
Select the columns that define uniqueness (e.g., “Country / Territory”)
Go to Home → Remove Rows → Remove Duplicates
Be precise—removing duplicates without selecting the right columns can delete valid data.

Removing Error Data
Errors often appear after type conversions, merges, or calculations.
How to Remove Errors
Select the column with errors
Go to Home → Remove Rows → Remove Errors
Or use M code:
Table.RemoveRowsWithErrors(Source, {"Forecast"})
Check for error icons in column headers after transformations.
Bonus: Replacing or Filling Nulls
Sometimes you don’t want to remove nulls—you want to fix them.

Replace Nulls
Use Transform → Replace Values → Replace null with a default value

Fill Down or Up
Use Transform → Fill Down or Fill Up to propagate values
Example:
Table.FillDown(#"Removed Duplicates",{"Country / Territory"})
Useful for grouped or hierarchical data.
Best Practices for Data Cleaning
Always preview your data before cleaning
Document each step in the Applied Steps pane
Use dynamic filters instead of hardcoded values
Test cleaned data with sample visuals or summaries
Save intermediate queries for reuse and auditing
Ready to Clean Smarter?
Now it’s your turn.
Open Power Query, load a messy dataset, and try removing blank rows, unnecessary columns, duplicates, and errors. Watch your data transform into something powerful.
Here is this lesson's example:
Want more Power Query mastery? Check out:
[How to Detect and Fix Data Type Issues]
[Creating Conditional Columns for Smarter Filtering]
[Using Query Folding to Speed Up Performance]
Got a stubborn dataset or a weird error? Drop a comment or reach out—I’d love to help.
Final Thoughts
Cleaning data isn’t just a technical step—it’s the foundation of every reliable report and confident decision. Power Query gives you the tools to do it fast, smart, and repeatably.
So next time your dataset looks like a mess, don’t panic. You’ve got the skills—and the tools—to clean it up and make it shine.