Power Query Skills: 0/5
ACCT 311 • Data Preparation

Build a Repeatable Power Query Pipeline

Excel formulas are excellent for calculations and analysis. Power Query is especially useful when the same imported data must be cleaned, reshaped, combined, and refreshed again.

Business scenario

The monthly sales export needs preparation before analysis

You receive a monthly sales export from an operating system. The file contains combined fields, inconsistent text, month columns spread across the worksheet, and coded region values. Your job is to build a preparation process that can be reused next month.

Think in two layers: Power Query prepares the data. Excel formulas, PivotTables, and charts can then analyze the prepared data.

Applied Steps

One reusable query

Each revealed task adds or reuses a recorded transformation step.

Source data

Start with Q1. The second file later adds Q2 columns so you can test refresh behavior.

Sales Data • Q1

Order_InfoCategoryRegion_IDJan_SalesFeb_SalesMar_Sales
ORD101-smith  lapTOps R01120015001100
ORD102-JONESTabLEts   R02800950900
ORD103-davis monitorsR01450500480

Region Mapping

Region_IDRegion_Name
R01North America
R02Europe
R03Asia Pacific
R04Latin America

Updated source • Q2 columns arrive USED IN TASK 5

Order_InfoCategoryRegion_IDJan_SalesFeb_SalesMar_SalesApr_SalesMay_SalesJun_Sales
ORD101-smithlapTOpsR01120015001100130014001500
Five connected transformations

Problem → Predict → Reveal → Verify

Make a prediction first. Then reveal the Power Query step and inspect what changed.

Task 1 • Split a combined field

Separate Order ID from Salesperson

The source stores two pieces of information in one field: ORD101-smith.

Worksheet approach

Text formulas such as LEFT, RIGHT, FIND, or TEXTSPLIT can separate the values. That can be useful for worksheet calculations, but here the same imported field must be prepared repeatedly.

Prediction: what tells Power Query where to split?
Power Query transformation
Select Order_Info → Split Column → By Delimiter → Hyphen (-)
ORD101-smith
→
Order IDSalesperson
ORD101smith

Why it matters: the split becomes a recorded query step, so the same transformation can run again when the source is refreshed.

Task 2 • Clean inconsistent text

Standardize Category values

The source contains spaces and inconsistent capitalization such as   lapTOps .

Worksheet approach

TRIM and PROPER can clean text in worksheet formulas. Power Query is useful when you want those cleanup steps recorded as part of the import process.

Prediction: which sequence best cleans the value?
Two recorded text transformations
Raw
  lapTOps 
↓ Trim
lapTOps
↓ Capitalize Each Word
Laptops

Applied Steps idea: Power Query records each transformation. On refresh, it reruns the sequence in order.

Task 3 • Reshape wide data

Turn month columns into analysis-ready rows

Jan, Feb, and Mar are repeated measures stored as separate columns. For many analyses, the month should become a field rather than part of the column name.

OrderCategoryRegionJanFebMar
ORD101LaptopsR01120015001100
Prediction: which columns should stay as identifiers?
Unpivot Other Columns
Select Order, Category, Region → right-click → Unpivot Other Columns
Interactive reshape
Click Unpivot and Pivot to see the structure change
Wide source: each month is stored as a separate column.
1. Wide
Jan, Feb, Mar are columns.
2. Unpivot
Month becomes a field and Sales becomes a value.
3. Pivot
Month values become columns again.

Why it matters: unpivoting creates an analysis-ready long table. Pivoting is the reverse operation when a wide presentation is needed. Students should understand both directions, not just memorize the menu command.

Task 4 • Combine related tables

Bring Region Name into the sales data

The sales table has Region_ID. The mapping table has Region_ID and Region_Name. The shared key lets Power Query match the records.

Sales
Region_ID
R01
R02
Region Mapping
Region_IDRegion_Name
R01North America
R02Europe
Prediction: which field should be selected in both tables for the merge?
Merge using a common key
Home → Merge Queries
Select Region_ID in both tables → choose Left Outer → OK → expand Region_Name.
1
Sales table: keep every sales row.
2
Common key: match Region_ID to Region_ID.
3
Expand: bring Region_Name into the result.
Region_IDRegion_Name
R01North America
R02Europe

Left Outer Join, in plain language: keep every sales row and bring in a matching region name when one exists.

Task 5 • Reuse the pipeline next month

Q2 columns arrive: Apr, May, and Jun

The query was designed with Unpivot Other Columns, so the month columns are treated as a changing group rather than individually hard-coded fields.

JanFebMarAprMayJun
120015001100130014001500
Prediction: after Refresh All, what should happen?
Refresh reruns the recorded pipeline
Data → Refresh All
Before
Jan • Feb • Mar
→
After refresh
Jan • Feb • Mar • Apr • May • Jun

Important: this works because the query was designed with Unpivot Other Columns and the source structure expands appropriately. Good query design makes refresh workflows more resilient, but Power Query does not automatically handle every possible structural change.

Complete the five transformations

After all five reveals, the comparison and final takeaway will unlock.

0/5 completed

When Should I Use Power Query?

NeedExcel formulas / worksheet toolsPower Query
Calculate values in cellsExcellentNot its primary purpose
Interactive worksheet analysisExcellentLimited
Clean imported data repeatedlyPossible with maintained formulas and stepsExcellent
Reshape wide dataPossibleExcellent
Combine related tablesWorksheet lookup approaches can workMerge is designed for this preparation workflow
Repeat the same cleaning next monthRequires maintaining worksheet logicRefresh reruns recorded steps
Prepare imported data for analysisPossibleExcellent
Excel calculates. Power Query prepares.

In real workflows, you will often use both: Power Query prepares the data, and Excel formulas, PivotTables, and charts analyze it.

What you just learned

Split

One combined field into multiple fields.

Transform

Dirty text into a consistent standard.

Unpivot

Repeated period columns into analysis-ready rows.

Merge

Related tables using a common key.

Refresh

Run the recorded pipeline again on updated data.