How to Clean Data in Power BI

Cody Schneider8 min read

Building a powerful dashboard in Power BI starts long before you drag a single visual onto the canvas. Your reports are only as good as the data you feed them, which is why cleaning and preparing that data is the most important step. This article will walk you through the essential data cleaning techniques using Power BI’s built-in Power Query Editor, turning messy source files into a reliable foundation for your analysis.

What is Data Cleaning (and Why Does it Matter)?

Data cleaning, sometimes called data cleansing or data wrangling, is the process of fixing or removing incorrect, corrupted, duplicate, or incomplete data from your dataset. Think of it as a quality control process for your information. If you've ever pulled a report from a system and found glaring errors - like typos in customer names, sales numbers formatted as text, or big empty gaps where dates should be - you’ve seen messy data firsthand.

Why is this so important? The simple answer is "garbage in, garbage out." If your underlying data is flawed, your Power BI reports and dashboards will be, too. Key metrics will be wrong, charts will be misleading, and the business decisions you make based on that information could be seriously off-track. Taking the time to clean your data upfront ensures that your analysis is accurate, trustworthy, and actually useful.

Your Data Cleaning Toolkit: The Power Query Editor

Power BI's secret weapon for all things data preparation is the Power Query Editor. This is a powerful tool that logs every cleaning and transformation step you make, allowing you to create a repeatable process that will automatically clean new data every time you refresh your report. It’s your workshop for getting your data ready for analysis.

To open it, connect to a data source (like an Excel file or database). Once the data preview shows up in the Navigator window, instead of clicking "Load," click "Transform Data."

When you open the Power Query Editor, you'll see a few key areas:

  • The Ribbon: A familiar interface at the top with tabs like Home, Transform, and Add Column, containing all the data cleaning tools you need.
  • The Queries Pane: A list on the left-hand side showing all the tables or queries you've connected to.
  • The Data Preview: The main window showing a preview of your table's rows and columns.
  • Applied Steps: A list on the right-hand side. This is the most magical part - it records every single change you make. You can click on previous steps to see what your data looked like at that stage, and you can even delete or reorder steps.

Common Data Cleaning Tasks in Power BI

Let's walk through some of the most common data messes you'll encounter and how to fix them inside the Power Query Editor.

1. Removing Unnecessary Rows and Columns

Most raw data exports come with extra baggage - columns you don't need or summary rows at the top and bottom that will interfere with your calculations. Cleaning this up is usually the first step.

Removing Columns

This is as simple as it gets. To remove a single column, right-click on the column header and select Remove. To remove multiple columns, hold down Ctrl, click on each column header you want to remove, then right-click on one of them and select Remove Columns.

Pro Tip: An even better method is often to select the columns you do want to keep, right-click, and select Remove Other Columns. This can make your query more resilient if the column names in your source file ever change.

Removing Rows

Often, spreadsheets include header rows or summary rows that you need to get rid of.

  • In the Home tab of the ribbon, click the Remove Rows button.
  • You'll get a dropdown with options like:

2. Correcting Data Types

This is one of the most common and critical steps in data cleaning. Power BI tries to automatically detect the data type for each column (e.g., Text, Whole Number, Date), but it doesn't always get it right. If your Sales column is incorrectly formatted as "Text," you won’t be able to sum it. If your Order Date is stored as "Text," you can’t use Power BI’s built-in time intelligence features.

To change a data type:

  1. Look at the icon on the left side of the column header (e.g., ABC for text, 123 for whole number, a calendar for date).
  2. Click the icon to bring up a menu of available data types.
  3. Select the correct one, such as Decimal Number for revenue, Date for a date column, or True/False for a boolean value.

Always double-check your data types, especially for dates and numbers, to ensure all your calculations will work correctly.

3. Handling Missing or Blank Values (Nulls)

Blank cells, which appear as null in Power Query, can cause problems in calculations and visuals. For example, if you're trying to calculate an average, having null values can skew the result. You have a few options for dealing with them.

Replace Null Values

In many cases, a null value really means zero. For a 'Units Sold' column, a blank probably means no units were sold. You can easily replace these.

  1. Right-click on the column header with the null values.
  2. Select Replace Values.
  3. In the "Value To Find" box, type null without quotes.
  4. In the "Replace With" box, type 0.
  5. Click OK.

You can also use this feature to replace nulls in a text field with something more descriptive, like "Not Available" or "N/A."

Fill Down / Fill Up

Sometimes, data is intentionally formatted with blanks. For instance, in an Excel file where a category is only listed on the first row of a group. You can use the Fill feature to fix this.

  1. Select the column where you need to fill the empty cells.
  2. Go to the Transform tab in the ribbon.
  3. Click on Fill and choose either Down or Up.

4. Cleaning and Standardizing Text Data

Text fields are often the messiest. Typos, inconsistent capitalization, and extra spaces can prevent you from grouping and filtering data correctly. For example, "usa", "USA", and "United States" would be treated as three separate countries in Power BI.

Trim, Clean, and Change Case

  • Right-click the column header and navigate to Transform. Here you'll find a few incredibly useful tools:

Splitting Columns

Sometimes, you have multiple pieces of information packed into a single column. A common example is a "Full Name" column that you'd rather have as "First Name" and "Last Name."

  1. Select the column you want to split.
  2. On the Home tab, click Split Column > By Delimiter.
  3. Power Query will often automatically detect the delimiter (like a space, comma, or dash). Adjust if needed.
  4. Click OK, and the column will be split into two new ones. You can then rename the new columns.

5. Adding and Transforming Columns

Sometimes you need to create new information from what you already have. The Add Column tab is your best friend here.

Column From Examples

This is an incredibly intuitive feature that works like magic. Let's say you have a product SKU like P-TEE-BLK-LG and you want to extract the color "BLK."

  1. Select the SKU column.
  2. Go to the Add Column tab and click on Column From Examples.
  3. A new, blank column will appear. In the first row, simply type the output you want - in this case, BLK.
  4. As you type, Power Query's AI will analyze the pattern and automatically fill in the rest of the column for you based on that same logic. If it gets it wrong, just correct another row or two until it understands the pattern.

This works for extracting parts of dates, text, numbers, and more, saving you from writing complicated formulas.

Final Thoughts

Mastering these basics in the Power Query Editor transforms data cleaning from a frustrating chore into a systematic process. By removing unnecessary data, fixing data types, handling nulls, and standardizing text, you build a solid and dependable dataset. This ensures that the insights you derive from your Power BI dashboards are accurate, professional, and ready to guide real business decisions.

While Power BI's tools are powerful, we know that spending time on data prep - especially when you’re pulling data from a dozen different marketing and sales platforms - can slow you down. We built Graphed to automate that entire process for you. Instead of manually cleaning sources one by one, you just connect platforms like Google Analytics, Shopify, Facebook Ads, and Salesforce in one click. We handle the annoying data blending and cleaning on the back end, so you can just ask questions in plain English like, "Show me my ad spend vs. revenue by campaign," and instantly get a live, real-time dashboard without ever even opening a query editor.

Related Articles

How to Connect Facebook to Google Data Studio: The Complete Guide for 2026

Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.

Appsflyer vs Mixpanel​: Complete 2026 Comparison Guide

The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.