Power Query, My Hero

Data cleaning doesn't have to be feared... if you have the right tools. So stop cleaning data by hand. Power Query makes it faster and actually kind of fun.

Disclosure: Some links in this post are affiliate links. If you make a purchase through one of my links, I may receive a small commission at no extra cost to you! As an Amazon Associate I earn from qualifying purchases.

Move over, SQL, there’s a new tool in town.

Nah, I’m just kidding. Kind of. And it’s not even new. Just highly underrated

Even though SQL is one of a data analyst’s most important technical tools, Excel comes up pretty close. And with it, we get the powerful Power Query engine, which can make data transformation and cleaning that much simpler. If you haven’t had a chance to try it yet, you’re in for a real treat.

Imagine all the work you have to do in Excel to combine tables from different sheets, or clean up the formatting in a column. Now, imagine the process is cut down to less than half the time. That’s Power Query for you.

Long gone are the days when you have to manually fix typos and update formulas. Keep reading and you’ll find out just how much data prep time you can save yourself.

In this post, you’ll learn:
  • What Power Query is and where to find it in Excel and Power BI.
  • Step by step how to append, merge, and clean your data.
  • Why it saves analysts hours, and what to do if you’re still not using it.

What Is Power Query And Why Do Analysts Rely on It?

Power Query is a data connection and transformation tool built into Excel and Power BI. Think of it as the data prep room where you bring in messy raw files, clean them up, and send the nice, polished version into your model or pivot table.

If you’re familiar with the term “ETL” (Extract-Transform-Load), then this is Microsoft’s version of that. It allows you to grab data, transform (clean) it, and load it to the destination for the next step in your workflow (building a report or dashboard).

Ever used Power BI? If you’ve clicked “Transform Data,” then you’ve already used Power Query, even if you didn’t realize that’s what it was.

Where You’ll Find It

Power Query is not an add-on tool that you need to download. It comes as part of these Microsoft products:

  • Excel (under the “Data” tab → “Get & Transform Data”)
  • Power BI (as the “Transform Data” step before loading your model)
  • Power Platform / Dataflows / Azure
  • Microsoft tools like Dataverse, Dynamics, and others

Are you starting to see why it’s such an important tool to learn?

7 Ways Power Query Saves You Hours of Data Cleaning

We don’t have time to play around with spreadsheets all day. We need to do things accurately and with minimal downtime, so if the process can help get us away from manually fixing or updating things, then we’ll do that.

Power Query can do a ton of tasks that will make our lives easier, especially when working with Excel exports, reports, SQL query outputs, survey data, or SharePoint lists.

Let’s break this down by task.

1. Append Data (a.k.a. Stack Tables Together)

Let’s say your marketing team sends you five monthly CSVs, all in the same format, but they contain different data.

Without Power Query:

You open each file, copy/paste the rows into a master file, and hope no one added an extra header or blank row.

With Power Query:

You point to the folder, and it pulls in all files with the same structure and stacks them into one table. Want to refresh next month? Just drop the new file into the folder. Done.

  • Go to Data → Get Data → From Folder
  • Choose the folder where your files live
  • Click Combine & Load
  • Power Query will show you a preview → Confirm it’s combining them correctly
  • Clean once (remove extra rows, fix column types)
  • Click Close & Load
Power Query

2. Merge Tables (Like a Smarter VLOOKUP)

You’ve got one table with customer orders and another with product info. You need to bring in product names.

Without Power Query:

You write a VLOOKUP or XLOOKUP (or even INDEX/MATCH) and deal with errors and file links breaking every time the source changes.

With Power Query:

You do a left join. Or an inner join. Or whatever join makes sense. Power Query handles it, and shows you a clear step in your list so you know what happened.

  • Load both tables into Power Query (use Get Data → From Workbook, or load from sheets)
  • Select your base query (e.g., Orders)
  • Click Merge Queries
  • Choose the matching column (like Customer_ID)
  • Select your join type (Left Join is usually safest)
  • Expand the joined table to bring in just the columns you need
  • Rename and clean as needed
  • Now the merged data updates automatically with new records — no need to redo the logic.
Merge queries in Power Query

3. Clean and Transform Data

Every data analyst has seen weird inputs like:

  • Dates stored as text
  • Columns named “Unnamed: 3”
  • Random blank rows
  • Typos and inconsistent values like “NA”, “null”, “n/a”, “None”, and “(blank)”


With Power Query, you can:

  • Change data types (text to date, number to currency, etc.)
  • Rename columns
  • Remove blank rows and columns
  • Replace or remove error values
  • Trim whitespace
  • Split columns by delimiter (like first/last names)
  • Remove duplicates
  • Filter out irrelevant data
  • Replace inconsistent values
Sql skill boost

Tired of googling the same SQL problems every week?

Learn and practice SQL here:

How to clean your data:

  • Remove rows:
    • Right-click → Remove Top Rows, or use a filter to get rid of nulls
  • Promote headers:
    • Use the Use First Row as Headers button
  • Change types:
    • Right-click a column → Change Type → Choose your format (Date, Text, Number)
  • Trim text:
    • Select a column → Transform → Format → Trim
  • Replace values:
    • Right-click → Replace Values (to fix “n/a” or blank strings)
  • Remove duplicates:
    • Select column(s) → Remove Duplicates

You’ll see every cleaning step in the Applied Steps pane on the right, all editable, reorderable, and reusable.

It even keeps the list of every cleaning step you’ve done. Want to change the filter logic you applied two weeks ago? Just go edit that step. There’s no redoing anything.

Power Query settings

4. Pivot and Unpivot Data

If you’ve ever received data that’s in the wrong shape, like values spread across columns when they should be rows, Power Query’s Unpivot feature is your new best friend. For example, you’ve got columns like “Jan”, “Feb”, “Mar”… and you need them stacked under a single “Month” column.

You can:

  • Unpivot columns to turn headers into rows
  • Pivot rows into columns (like summarizing values by category)
  • Group data and apply aggregations (like sum, average, count, etc.)
  • Great for survey data, financials, or restructuring reports from other teams.

How to unpivot:

  • Select the month columns
  • Click Transform → Unpivot Columns
  • Rename the new columns to “Month” and “Sales” (or whatever fits)

This is especially useful for survey responses or financials spread across time columns.

You can also Group By to aggregate data, or Pivot Columns to flip rows into headers.

Image Credit: Microsoft

5. Combine Data from Multiple Sources

Power Query can connect to a variety of data sources, including:

  • Excel, CSV, TXT
  • SQL Server, MySQL, PostgreSQL
  • SharePoint lists and folders
  • APIs and web data
  • Power BI datasets
  • Dataverse, Dynamics 365
  • JSON/XML/ODBC
  • And yes, even PDFs

So you can load your budget from Excel, your actuals from SQL, your notes from SharePoint, and combine it all, with no exporting required.


Everything in Excel that a data analyst needs to know.

6. Add Conditional Columns Without Formulas

Need to label sales as “High”, “Medium”, or “Low” based on a revenue column?

Without Power Query:

You’d write an =IF() formula, drag it down, and hope the rows don’t shift later.

With Power Query:

You add a conditional column with a friendly interface. No syntax errors. You can also write custom logic using M code if you want more control.

  • Click Add Column → Conditional Column
  • Choose your logic:
  • If [Sales] > 10000 then “High”
  • If [Sales] > 5000 then “Medium”
  • Else “Low”

It’s easier to read than nested IF() statements, and you can update it anytime without breaking your file.

7. Automate Recurring Work

Power Query really shines here: automation.

Power Query isn’t just a one-time tool; it’s a reusable process. You build it once, then refresh your data every day/week/month, or whatever you require.

For example:

  • You build a Power Query that cleans sales data and combines it with budget targets.
  • Every Monday, your team drops new files into a folder.
  • You hit “Refresh” in Excel or Power BI.
  • Your entire dashboard updates with fresh data.

No one touches the source. No one copies and pastes. The cleaning process stays consistent every time.

What You’d Be Stuck Doing Without Power Query

Without Power Query, you’d spend your weeks doing the same manual work over and over. You’d be copy-pasting the same data each week, relying on VLOOKUPs that break every time a column moves. You’d end up rewriting the same cleaning steps in every new workbook and constantly fixing human errors from manual data entry. Most of your time would go toward just preparing the data instead of actually analyzing it.

With Power Query, you clean and transform your data once, then reuse that setup forever.

Let’s look at a financial data example to illustrate this.

Example: Monthly Financial Reporting

Let’s say you are given:

  • 5 Excel files from different departments
  • Each one has slightly different column names (thanks, Finance)
  • Some include budget and actuals, others just actuals
  • You need to combine them, fix the formats, and add region and month info

Without Power Query:

  • You open each file manually
  • Rename columns by hand
  • Copy-paste into one sheet
  • Fix date formats
  • Add calculated columns with formulas
  • Repeat this every. single. month.

With Power Query:

  • You connect to a folder
  • Standardize column names using a mapping table
  • Append all files
  • Add conditional columns and calculated fields
  • Save the query

Next month? Drop the new files in.

Refresh.

Done.

Your several-hour process just got done in a few minutes.

Why Power Query Belongs in Every Analyst’s Toolkit

Power Query is one of those tools that feels small until you start using it. But once you realize just how much it can do, your whole workflow changes.

Now, instead of spending 60% of your time just getting data prepped and ready for analysis, you spend that extra time analyzing, visualizing, and presenting insights. The fun stuff!

And you don’t need to be technical or know how to code to use Power Query. You just need to understand your data and the logic behind what you want to do with it.

5 main features of power query by Data With Sarah

How to Learn Power Query

If you’re ready to take back some of your time, here are some resources worth checking out:

Or just open Excel or Power BI and start playing around with it. That’s the best way to learn. Trust me, you’ll wish you knew how to use it much sooner.

More helpful sites can be found on the Resources page.

So… Why Are You Still Cleaning Data by Hand?

There’s no trophy for cleaning data the hard way.

If you’re still manually copying rows between spreadsheets or updating formulas every time a column shifts, please know, there’s a better way.

Power Query is the underrated tool that does exactly what you wish Excel could do… but faster, cleaner, and without breaking everything when someone adds an extra space.

And remember, you don’t need to be technical, nor do you need to memorize any formulas. You just need to stop doing the same repetitive data prep 40 times a month.

Try it once. If you use Excel, Power Query will be your new hero, too.

What’s your favorite Power Query trick? Or the one task it finally saved you from?


Liked this post?

Subscribe to my newsletter and check out my data analytics resources. Your future self will thank you. Don’t forget to follow me on LinkedIn.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Sarah Rajani
Sarah Rajanihttps://www.linkedin.com/in/sarahrajani1/
I'm Sarah, a senior data analyst and writer. I run Data With Sarah, where I share practical tips, tools, and career advice for working in analytics.

Popular

Related Posts

Popular Categories