Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Power Query for Beginners: Clean and Combine Data Easily

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Power Query is a data transformation tool built into Excel and Power BI that lets you import, clean, and combine data from multiple sources without writing code. It automates repetitive tasks like removing blank rows, splitting columns, or merging tables — saving hours of manual work. You don’t need programming skills to use it, but you do need Excel 2016 or later (including Microsoft 365) or Power BI Desktop installed. If you work with spreadsheets, databases, or web data regularly, Power Query will make your workflow faster and more accurate.

What You'll Need

  • Microsoft Excel 2016 or later (including Microsoft 365) or Power BI Desktop
  • A data source: Excel file, CSV, text file, database, or web page
  • Basic familiarity with Excel (opening files, navigating tabs)

Step-by-Step

  1. Open Excel or Power BI Desktop and load your data. In Excel, go to the Data tab and click Get Data > From File > From Text/CSV (or From Workbook if using an Excel file). In Power BI, select Get Data from the Home tab and choose your source.
  2. Select your file and click Load or Transform Data. If you click Load, the data goes directly into a worksheet. If you click Transform Data, Power Query Editor opens — this is where you clean and shape the data.
  3. In Power Query Editor, review the data preview. Look for issues like missing headers, extra rows, or inconsistent formatting. If the first row isn’t your column headers, click Use First Row as Headers under the Home tab.
  4. Remove unwanted rows. Select any blank or header-repeating rows, right-click the row number on the left, and choose Remove Rows > Remove Blank Rows. Repeat if needed.
  5. Fix data types. Click the icon under each column header (e.g., ABC, 123, or PI). Change it to Text, Whole Number, Decimal Number, or Date as appropriate. This prevents errors in later steps.
  6. Split or combine columns. If a column has combined data (like "John Doe" in one cell), select the column, then click Split Column > By Delimiter. Choose a space, comma, or custom character. To combine columns, select them, right-click, and choose Merge Columns.
  7. Remove unwanted columns. Click the column header to select it, then press Delete. You can also right-click and choose Remove.
  8. Filter data. Click the dropdown arrow in a column header, uncheck items you don’t need (e.g., blank values or "N/A"), and click OK.
  9. Renaming columns: Double-click the column header to edit the name. Use clear, consistent names like "OrderDate" instead of "Column1".
  10. Apply changes. Click Close & Load to send the cleaned data to Excel as a new table, or Close & Load To if you want to load to a PivotTable or Data Model.
  11. Refresh data later. If your source file changes, right-click the table in Excel and select Refresh, or go to Data > Refresh All. Power Query automatically reapplies all your steps.

Common Mistakes

  • Clicking Load instead of Transform Data — this skips cleaning and forces you to clean in Excel, which is harder and not repeatable.
  • Not checking data types — leaving numbers as text causes SUM or AVERAGE functions to fail silently.
  • Forgetting to remove blank rows — these can cause errors in pivot tables or charts.
  • Editing the raw data after loading — any manual changes overwrite Power Query’s transformation. Always edit the source file or update steps in Power Query Editor.
  • Merging tables without matching keys — if you combine two tables, the columns you use to join them must have identical values and data types (e.g., "ID" as Whole Number, not Text).

Tips

  • Always use Transform Data, not Load, on your first import — you can always go back to the Power Query Editor later by right-clicking the table and selecting Edit.
  • Use the Applied Steps pane on the right to see every action you’ve taken. You can delete or reorder steps if something goes wrong.
  • Save your source files in a stable location (like Documents or a network drive) — if you move or rename them, Power Query can’t find them on refresh.
  • Use the Search box in Power Query Editor to quickly find a step or column name.
  • For web data, use the URL directly, not a copied webpage. Power Query can’t parse HTML tables well unless they’re properly structured.
  • Copy and paste steps between queries: Right-click a step in the Applied Steps pane and choose Copy, then paste into another query to reuse logic.

Troubleshooting

  • If Power Query fails to load data, check your internet connection for web sources or file permissions for local files.
  • If you see "Expression.Error: We couldn't find the file", your source file was moved or renamed. Go to Data > Queries & Connections, right-click the query, select Properties, then update the file path.
  • If column types reset after refresh, reapply them in Power Query Editor and click Close & Load again — this fixes it permanently.
  • If a merge returns blank results, check that both columns used for joining have matching data types and no extra spaces. Use Text.Trim on both columns before merging.
  • If Excel freezes during refresh, close other programs and try refreshing again. Large datasets (>100,000 rows) can slow down older machines — consider filtering early to reduce volume.
  • If you accidentally close Power Query Editor without saving, reopen it via the Data tab > Queries & Connections > right-click your query > Edit.

Frequently Asked Questions

Can I use Power Query on a Mac?

Yes, if you have Excel for Microsoft 365 on Mac. The interface is nearly identical to Windows.

Does Power Query work with Google Sheets?

Not directly. You must export data from Google Sheets as a CSV or Excel file first, then import it into Power Query.

Can I combine data from multiple Excel files?

Yes. In Power Query, go to Get Data > From File > From Folder, select the folder containing your files, then click Combine & Transform Data.

Is Power Query the same as VBA?

No. Power Query uses a visual, step-by-step interface; VBA requires writing code. Power Query is easier for beginners and automatically updates when sources change.

What happens if I delete the original data file?

Power Query will show an error on refresh because it can’t find the source. You must restore the file or update the file path in the query properties.

Can I use Power Query to connect to a database?

Yes. Use Get Data > From Database and choose SQL Server, Access, PostgreSQL, or others. You’ll need the server name and login credentials.