Excel & Data

How to Clean Messy Excel Data in Power BI (3 Common Fixes)

If you're an Excel user, you know the drill: importing data, spotting inconsistencies, and then spending hours manually correcting errors. From decimal numbers appearing where whole numbers belong to inconsistent text entries, cleaning messy Excel data is often the most time-consuming part of any analysis. But what if you could automate this process, creating a repeatable "recipe" for clean data that saves you hours every month?

Power BI offers a powerful solution through its Power Query Editor. This tool allows you to transform your raw Excel data into a clean, structured format, and the best part is that these cleaning steps are recorded. This means the next time you get updated data, Power BI can automatically apply all your previous cleaning steps with a single refresh. This article will walk you through three common data cleaning fixes, showing you how to clean data in Power BI from Excel and move beyond manual spreadsheet corrections.

Power BI data cleaning tutorial thumbnail showing Power Query Editor interface with data transformation steps
Recommended Course on JunoPower BI
View Course →

Stop Cleaning in Excel: A Better Way in Power BI

Many analysts are accustomed to cleaning data directly within Excel, using formulas, text-to-columns, and manual find-and-replace operations. While effective for one-off tasks, this approach becomes a significant bottleneck when you receive updated data regularly. Each month, you're forced to repeat the same tedious steps, increasing the risk of errors and consuming valuable time.

Power BI's Power Query Editor changes this workflow entirely. Instead of manual cleaning, you build a series of transformations within Power Query. Think of it as creating a custom cleaning script. Once defined, this script is saved as part of your Power BI report. The next time your source Excel file is updated, all you need to do is hit 'Refresh', and Power Query will automatically apply every cleaning step you've configured. This is the essence of why learning to automate data cleaning in Power Query vs. manual Excel is such a game-changer for efficiency.

This process of defining and applying transformations is a core part of how you power query transform data. It ensures consistency, reduces manual effort, and frees you up to focus on analysis rather than repetitive data preparation.

Fix 1: Correcting Data Types (e.g., Decimals in 'Units Sold')

One of the most frequent issues when importing data from Excel into Power BI is incorrect data type detection. Power Query tries its best to guess the data type for each column, but it doesn't always get it right. A common scenario is when a column that should contain whole numbers (like 'Units Sold' or 'Quantity') is imported as a decimal number type.

For instance, imagine you have a column for "Units Sold." As one of our experts explains, "This 'Units Sold' column... I know I won't sell half an item... I'll change it to a whole number." This highlights a practical reason why accurate data types are essential for correct calculations and visualizations. If Power BI treats 'Units Sold' as a decimal, aggregation functions might produce unexpected results, or your visuals might display unnecessary decimal places.

How to change data type in Power BI from decimal to whole number:

  1. Open the Power Query Editor (from Power BI Desktop, click 'Transform data' on the Home tab).
  2. Locate the column you want to change (e.g., 'Units Sold').
  3. Click on the icon to the left of the column header (this icon represents the current data type, often '1.2' for decimal).
  4. A dropdown menu will appear. Select 'Whole Number'.
  5. Power Query will ask if you want to replace the current step or add a new one. Choose 'Replace Current' if you're correcting an automatic type change, or 'Add New Step' if you're intentionally changing it after other transformations.

This simple step ensures that your numeric data is interpreted correctly, allowing for accurate aggregations and cleaner reports. This is a fundamental way to change data type power bi and specifically to implement power bi change decimal to whole number.

Fix 2: Standardizing Text (e.g., Inconsistent 'Segment' Names)

Text data often comes with inconsistencies that can severely impact your analysis. For example, a 'Segment' column might contain entries like 'B2B', 'b2b', and 'B2b'. From a human perspective, these all mean the same thing, but to Power BI, they are distinct values. This leads to fragmented data in your reports, where a single segment appears multiple times in charts or filters, making it hard to get an accurate overview.

As our expert notes, "B2B is all caps, then there's a small one, meaning camel case... if you visualize this from a graph perspective... consistency is important in your data." Inconsistent capitalization is a common culprit. To ensure all variations are treated as a single entity, you need to standardize them.

How to make all text uppercase in Power BI Power Query:

  1. Open the Power Query Editor.
  2. Select the column that contains inconsistent text (e.g., 'Segment').
  3. Go to the 'Transform' tab in the Power Query Editor ribbon.
  4. Click on the 'Format' dropdown.
  5. Select 'UPPERCASE'.

Power Query will instantly convert all text entries in that column to uppercase, effectively merging 'B2B', 'b2b', and 'B2b' into a single 'B2B' value for analysis. This is a quick and effective way to power bi make all text uppercase and ensure consistency across your text fields.

Fix 3: Renaming Columns for Clearer Reports

Sometimes, the column headers in your raw Excel data are not ideal for reporting. They might be too long, contain special characters, or use abbreviations that aren't intuitive for someone viewing your final Power BI report. For instance, a column named 'Month name' might be perfectly clear in your source Excel sheet, but for a clean and professional Power BI dashboard, 'Month' is often preferred.

Our expert demonstrates this exact scenario, stating, "In renaming the column, it's mentioned above that we changed 'Month name' to 'Month'." Renaming columns in Power Query ensures that your visuals and tables in Power BI use clear, concise, and user-friendly labels, making your reports easier to understand and more impactful.

How to rename columns in Power Query:

  1. Open the Power Query Editor.
  2. Locate the column you wish to rename (e.g., 'Month name').
  3. You have two primary ways to rename:
    • Double-click: Double-click directly on the column header, type the new name (e.g., 'Month'), and press Enter.
    • Right-click: Right-click on the column header, select 'Rename', type the new name, and press Enter.

This simple transformation significantly improves the readability and professionalism of your Power BI reports. Learning these essential data cleaning and transformation techniques is fundamental to building effective dashboards, and Juno School's free Power BI certificate course covers these and many other critical skills to help you master the platform.

Your Secret Weapon: Understanding 'Applied Steps'

After performing these fixes, you might wonder how Power BI remembers all these changes. The magic lies in the 'Applied Steps' pane, located on the right side of the Power Query Editor interface. Every single transformation you apply—changing a data type, standardizing text, renaming a column—is recorded here as a distinct step.

As our expert highlights, "On the right, you will also see the applied steps, meaning what all we have done." This pane is essentially a history log of your data cleaning 'recipe'. You can review each step, reorder them, modify them, or even delete them if you make a mistake. More importantly, when you refresh your data source, Power Query executes these steps in order, automatically applying all the cleaning and transformations to your new data.

This automatic application of power query transform data steps is what makes Power BI so powerful for data preparation. It transforms a tedious, manual process into an automated, repeatable workflow, saving you countless hours and ensuring consistent data quality across all your reports. Understanding and utilizing the 'Applied Steps' pane is key to truly leveraging Power Query for efficient data management.

Ready to level up your career?

Join 5 lakh+ learners on the Juno app. Certificate courses in Hindi and English.

Get it onGoogle Play
Download on theApp Store