Power Query Builder is the graphical interface inside Microsoft Excel and Power BI that lets you connect to data sources, clean and transform data, and load the result into a table or data model—without writing code. To use it, you need a desktop version of Excel (2016 or later, or Microsoft 365) or Power BI Desktop, and a data source such as a CSV file, an Excel workbook, or a database. The steps below apply to both Excel and Power BI; menu labels can differ slightly by version, device, or region.

What You'll Need

  • A Windows or Mac computer with Excel 2016 or later (Microsoft 365 recommended) or Power BI Desktop installed.
  • A data source you can access—for example, a local CSV file, an Excel workbook, or a database you have credentials for.
  • Basic familiarity with rows and columns; no programming knowledge required.

Step-by-Step

  1. Open the Power Query Editor. In Excel, go to the Data tab and click Get Data (or Get & Transform Data in older versions). In Power BI Desktop, click Home > Transform data to launch the Power Query Editor. This opens a separate window with the ribbon, a queries pane on the left, and a data preview.
  2. Connect to your data source. Click Get Data (or New Source) and choose the type—for example, Text/CSV, Excel, or SQL Server. Browse to your file or enter the server and database details, then click OK. If prompted, preview the data and click Transform Data (not Load) so you can clean it first.
  3. Review the applied steps. On the right side, the Applied Steps pane records each transformation. You can click any step to see the data at that point, rename a step, or delete it. This is your undo history—nothing is permanent until you load the data.
  4. Clean and shape the data. Use the ribbon to:
    • Home > Remove Rows > Remove Top Rows to drop header junk.
    • Home > Use First Row as Headers to promote the first row to column names.
    • Transform > Replace Values to fix typos or standardise text.
    • Add Column > Custom Column to create a new column with a formula (for example, [Price] * [Quantity]).
    • Transform > Data Type to set each column to Text, Whole Number, Date, etc. This is crucial for correct calculations later.
  5. Filter and sort. Click the dropdown arrow on a column header to filter out blanks or unwanted values, or to sort ascending/descending. Filters are saved as steps and refresh with the data.
  6. Combine queries if needed. To merge two tables, go to Home > Merge Queries and select the matching columns. To stack tables with the same columns, use Home > Append Queries. The result is a new query that stays linked to the sources.
  7. Load the result. When finished, click Home > Close & Load (Excel) or Home > Close & Apply (Power BI). In Excel, choose Table to place the data on a worksheet, or Only Create Connection to use it in the data model. In Power BI, the data loads into the model automatically.
  8. Refresh when source data changes. In Excel, right-click the loaded table and choose Refresh, or use Data > Refresh All. In Power BI, click Home > Refresh. The query re-runs all applied steps against the source. For files that move, edit the source path in Data > Queries & Connections (Excel) or Transform data > Data source settings (Power BI).

Common Mistakes

  • Not setting data types. Leaving a number column as Text prevents sums and averages. Always set types explicitly before loading.
  • Renaming columns in the wrong place. Renaming in the worksheet after loading breaks the query link. Rename inside the Power Query Editor instead.
  • Deleting steps out of order. Removing an early step can break later steps that depend on it. Check the preview after each deletion.
  • Loading to the wrong destination. Choosing Only Create Connection when you wanted a table leaves you with no visible data. You can change this later in Data > Queries & Connections > Properties.
  • Ignoring query folding. When connecting to a database, some steps (like filters) can be pushed to the server for speed; others cannot. If refresh is slow, review the steps to see which ones break folding.

Tips

  • Use Advanced Editor (under Home) to view or edit the M code behind your steps—useful for copying logic between queries.
  • Name your queries meaningfully in the Queries pane; these names become table names in the data model.
  • Keep a Documentation query: a blank query where you paste notes about sources and transformations. It loads as a connection only.
  • For recurring reports, store source files in a fixed folder and use Data > Get Data > From File > From Folder to combine all files automatically.
  • Test with a small sample first: filter to a few rows, load, and verify the output before refreshing the full dataset.

Troubleshooting

If the query fails to refresh, start with the simplest checks: confirm the source file or database is reachable and that your credentials are still valid (edit them in Data > Queries & Connections or Data source settings). Next, look at the error message in the Applied Steps pane—it often names the step that failed. Common fixes: a column was renamed at the source (update the step that references it), a data type changed (reset the type), or a file path moved (edit the source path). If the preview shows unexpected blanks, check for hidden rows or filters applied earlier. For slow refreshes, reduce the number of rows at the source with a filter step, or remove unnecessary columns early. If the editor crashes, close and reopen Excel or Power BI; your unsaved steps may be lost, so save frequently. As a last resort, recreate the query from scratch using the same steps—this clears corrupted metadata.

Frequently Asked Questions

Do I need Power BI to use Power Query?

No. Power Query is built into Excel 2016 and later (called Get & Transform in some versions). Power BI Desktop includes the same engine with a nearly identical interface.

Can I undo a step after loading?

Yes. Reopen the Power Query Editor, select the step in the Applied Steps pane, and delete it or click the X. Then close and load again. Changes are not applied until you refresh or reload.

Why does my query show errors after a source update?

Most often a column name or data type changed at the source. Open the editor, find the step with the error, and update the reference or reset the data type. The error message usually points to the exact step.

Can Power Query combine multiple files from a folder?

Yes. Use Get Data > From File > From Folder, point to the folder, and combine the files. All files must have the same column structure for a clean append.

Is Power Query available on Mac?

Excel for Mac includes a version of Power Query, but some connectors and features (such as certain database drivers) may be limited compared with Windows. Check Microsoft's documentation for your Excel version.

How do I share a query with a colleague?

In Excel, save the workbook and share the file—queries are stored inside it. In Power BI, publish the report to a workspace, or export the query as a template (PBIX) and share that. Avoid copying steps manually unless necessary.