Chapter 11 · 7 levels

Power Query

Import a CSV or a database table and clean it with Applied Steps: remove columns, filter rows, change types, split and combine columns, add custom columns, merge and append queries, then refresh.

Start

Every month the same export lands in your inbox, and every month you do the same ten things to it: delete the columns nobody needs, drop the cancelled orders, fix the prices that came in as text, add a total. Power Query is the part of Excel that records those ten things once, as a list of Applied Steps, and replays them on next month’s file with one click on Refresh.

In this chapter you work in a practice editor built for this site. It is not Power Query and it does not run Excel; it gives you Power Query’s way of working: you start from an imported table (the Source step), add steps one per line, watch the table change after each one, and the checker compares the final table with the answer. The step names, the order you add them in and the results match what Power Query does, so the thinking carries straight over. Every lesson also gives the real Excel path (Data → Get Data → … → Transform Data) and the M code the step writes, so you can do the same thing at your desk.

You will clean a marketplace order report, split a payment code to recover the order number, build totals and a month column, look up customer discounts with Merge, stack two quarters with Append, see why importing from SQL Server with a query beats importing a whole table, and finish with a boss level that turns a messy export into a revenue summary ready for a PivotTable.

Levels

  1. Import a CSV and clean it in three steps

    from Mei Morgan, Buyer

    power query, applied steps, import csv, filter rows, change type

    Code Difficulty 2 of 5 Not started

  2. Split a payment code, combine two columns

    from Amanda Perez, Accountant

    power query, split column, merge columns, rename column, change type, custom column

    Code Difficulty 2 of 5 Not started

  3. A total column, a month column, then one month

    from Rachel Ramirez, Merchandise Planner

    power query, custom column, date month, filter rows, m language

    Code Difficulty 3 of 5 Not started

  4. Merge a discount table, then price every line

    from Chloe Gutierrez, Account Executive

    power query, merge queries, left outer join, replace values, null values, custom column

    Code Difficulty 3 of 5 Not started

  5. Append Q3 under Q2

    from Shirley Chen, Buyer

    power query, append queries, rename column, column names, custom column

    Code Difficulty 3 of 5 Not started

  6. Import from SQL Server with a query

    from Aaron Ramos, Analytics Engineer

    power query, sql server, native query, source step, query folding

    Quiz Difficulty 3 of 5 Not started

  7. Boss: from a messy export to revenue by category

    from Thomas Whitaker, Head of Merchandising

    power query, change type, remove errors, merge queries, custom column, group by, refresh

    Boss · 3 steps Difficulty 4 of 5 Not started

Pick what may run on this site. You can change this any time from "Cookie settings" at the bottom of every page.