Business Intelligence with Power BI

L02 · Power Query I: Shape and Clean

Practice — Medium · Solution

Step-by-step

  1. Phone standardization — three Replace Values steps on the Phone column:
    ReplaceWithHeals
    .-184 dot-format rows
    ((nothing)167 paren-format rows
    (paren + space)-
    The 163 already-dashed rows pass through untouched — replacements that find nothing change nothing, which is what makes this recipe safe to replay on any month's file. Counts are the verified figures from the raw-file profile (of the 514 raw rows; after dedup yours total 500).
  2. Split. Name → Split Column → By Delimiter → space, at the left-most delimiter → rename to FirstName / LastName. Left-most matters: it splits once, so a name with any surprise in it degrades gracefully instead of spraying columns.
  3. The reorder (step 4). With Split moved above Trim, the 49 names with trailing spaces split into a LastName ending in a space — "Thorne " — because the split ran while the dirt was still there, and Trim afterward fixed only the original Name column, which no longer feeds anything. Result: the same disease you cured in Mild, reintroduced into a new column by sequencing alone. Dragged back below Trim, the split consumes clean input and the problem vanishes.

Reflection answers

  • The phone replacements were independent — none produced text another consumed. Trim-then-Split is a dependency: Split consumes what Trim produces. Order matters exactly when steps feed each other, and the Applied Steps list is where that dependency is visible and controllable.
  • In a spreadsheet: a helper column, a formula per format or a long nested SUBSTITUTE, fill down, paste-values, delete the helper — an hour, destroyed the moment next month's export replaces the file. Here: three recorded steps that replay forever. This asymmetry is the entire argument for the tool.