Power QueryExercises

Fix a Changed Type step that breaks two columns (kite shop)

An automatic type step turned customer names into errors and stripped the zeros from order numbers.

Level
beginner
Time
~6 min
Task
Fix a broken query
Access
Free — no account needed
Loading the practice workspace…

About this exercise

What you'll practise

Check an automatically added Changed Type step and correct the types it chose.

Northwind Kites sells kites and accessories through three regional stores. Orders are exported from the till system every week.

Steps

  1. The starter's Changed Type step types OrderID as a whole number (0042 becomes 42) and Customer as a number (every name becomes an error).
  2. Fix that step so OrderID and Customer stay text, Qty is a whole number and UnitPrice a decimal number (en-US).
  3. Output the four columns OrderID, Customer, Qty, UnitPrice.

Your result must

  • OrderID keeps leading zeros (text)
  • No error cells in Customer
  • Qty and UnitPrice are numbers

Input

  • OrderFile (file)
    • Text file; first line: OrderID,Customer,Qty,UnitPrice
    • Every field is text until you set types

Expected output columns

OrderID (text), Customer (text), Qty (number), UnitPrice (number)

First 3 of 10 expected rows
OrderIDCustomerQtyUnitPrice
0001Omar Abara514.69
0002Carmen Duarte512.13
0003Goran Varga353.3