Advanced / Lesson 07

Power Query foundations

Record a repeatable preparation process instead of repeating manual cleanup.

~40 minutes4 exercisesSee lesson notes for version and platform support

By the end, you’ll be able to:

  • Distinguish source data, query steps and loaded output
  • Import a small table with deliberate data types
  • Refresh safely and reconcile the prepared result

A query is a saved preparation recipe

Imagine a weekly order export with extra spaces in Region, quantities stored as text and an unwanted Notes column. Cleaning it manually each week is slow and easy to vary accidentally. Power Query saves ordered transformation steps and reapplies them when you refresh.

Separate three things: the original source, the query's transformation recipe, and the loaded result. Changing a cell in the loaded result does not rewrite the source or create a transformation step; a refresh can replace that change.

The browser exercises below check preparation decisions and reconciliation. The native import, editor and refresh tasks must be performed in a compatible Excel version; this website does not run Power Query.

Create your first table query in Windows desktop Excel

  1. Enter headings Order, Region, Units and Unit price in A1:D1. Add O101/East/3/20, O102/West/2/15 and O103/East/5/10 beneath them.
  2. Select the range, use Insert → Table, confirm headings, and name the table OrdersRaw.
  3. Select a table cell and choose Data → From Table/Range to open Power Query Editor.
  4. Name the query OrdersClean. Inspect the Source and any automatic Changed Type steps.
  5. Set Order and Region to Text, Units to Whole Number and Unit price to Decimal Number.
  6. Add Column → Custom Column, name it Sales, and use [Units]*[Unit price].
  7. Choose Home → Close & Load to return a table on a new sheet.

The custom-column expression is Power Query M syntax. Square brackets access fields; it is not an A1 worksheet formula and is not entered into the browser formula checker.

Data types express meaning

An identifier such as 00123 should remain Text if its leading zeros are significant. Units should be numeric so they can be added. A date string such as 04/05/2026 is ambiguous internationally: decide whether the source means 4 May or April 5, then use Change Type → Using Locale when needed.

Inspect errors after converting types. Replacing every invalid quantity with zero hides missing or malformed input. Investigate the source and choose a documented treatment, such as correcting the record or retaining an exception list.

For cleaning text, select the Region column and use Transform → Format → Trim where available. Trim removes surrounding whitespace; it does not prove that East and E are the same approved category.

Worked check: row count and total sales

The three practice orders produce Sales of 60, 30 and 50: three records and a total of 140. Compare that total with the source before trusting the output.

  1. Append O104/East/2/25 to the input table, ensuring it becomes part of the table.
  2. Refresh the query through Data → Refresh All or the query's Refresh command.
  3. Confirm four records and total Sales 190.
  4. Verify the new row received the same type and Sales transformations.

A refresh reruns the saved steps against accessible source data. It does not automatically know a renamed file's location or obtain another person's permissions. If you share a file-based query, the recipient may need a reachable source and updated source settings.

Check the available Excel tools

Power Query is integrated in supported Windows desktop Excel versions through Data/Get & Transform. Microsoft 365 for Mac and Excel for the web also have Power Query capabilities, but available import, editing, connector and refresh operations differ. Follow Microsoft's current platform table if a command is missing. Android and iOS do not support Power Query.

Use the detailed Windows table/range steps where those commands exist; other platforms may require Get Data and a supported source instead. A missing connector is a platform or license limitation, not a reason to buy anything to complete the browser exercises.

Now make it yours

Give it a try.

Work through each exercise, check your answer and use a hint whenever you need one. Formula tasks check changed inputs, including boundary cases.

0 of 4 exercises complete

Exercise 01 / Knowledge check

Correct the reusable process

You correct Eastt to East only in the query’s loaded worksheet output. What is the main risk on refresh?

Choose one answer
Exercise 02 / Knowledge check

Preserve an identifier

A customer code is 00123 and the leading zeros identify the account. Which Power Query data type should you choose?

Choose one answer
Exercise 03 / Knowledge check

Reconcile the initial result

The prepared table below shows Units and Unit price. Enter total Sales in F2; Sales equals Units × Unit price for each row.

Example worksheet with column letters and row numbers
ABCD
1OrderRegionUnitsUnit price
2O101East320
3O102West215
4O103East510
Exercise 04 / Knowledge check

Check a refresh

The initial total Sales is 140. One new valid order has 2 units at 25 each. After refresh, what should total Sales be?

Example worksheet with column letters and row numbers
AB
1MeasureValue
2Initial sales140
3New units2
4Unit price25

Take this with you

Power Query saves a preparation recipe. Keep inputs separate from output, set meaningful data types, and reconcile every refresh.

Practice in Excel

Download the course workbook, follow the tasks, save your completed .xlsx and check its supported formula tasks here. Native Excel features use a separate review checklist.

Download practice workbook Check my workbook ↗
Technical references and lesson review

Original lesson content. Technical behavior checked against Microsoft documentation. Reviewed 2026-10-16.

Find your next skill