The request

From Brittany Hayes, Events Manager
Your goal
The Source step is the CRM export of 54 Florida customers who signed up in 2025, every column as text. Change customer_id to a whole number and signup_date to a date; trim city and state; capitalize each word in city; make state uppercase; and replace "N/A" in referral_source with null.
- Show exactly
customer_idfirst_namelast_namecitystatesignup_datereferral_sourcenot done yet - 54 rowsnot done yet
Your query steps
| customer_id | first_name | last_name | city | state | signup_date | referral_source | |
|---|---|---|---|---|---|---|---|
| 1 | 1243 | Miguel | Garcia | Miami | FL | 2025-01-24 | |
| 2 | 1249 | Sarah | Gray | Orlando | FL | 2025-01-31 | search |
| 3 | 1263 | Frank | Cooper | Miami | FL | 2025-02-09 | friend |
| 4 | 1264 | Grace | Rodriguez | Orlando | FL | 2025-02-09 | search |
| 5 | 1270 | Benjamin | Kelly | Orlando | FL | 2025-02-13 | search |
| 6 | 1311 | Julie | Flores | Orlando | FL | 2025-03-12 | N/A |
| 7 | 1333 | Jamal | Miller | Jacksonville | FL | 2025-03-26 | |
| 8 | 1341 | Rebecca | Wood | Miami | FL | 2025-03-31 | search |
| 9 | 1352 | Catherine | Martinez | Miami | FL | 2025-04-06 | |
| 10 | 1354 | Joseph | Miller | Tampa | FL | 2025-04-08 | N/A |
| 11 | 1355 | Nathan | Morales | Tampa | FL | 2025-04-08 | search |
| 12 | 1363 | Aaron | Coleman | Tampa | FL | 2025-04-12 | N/A |
| 13 | 1366 | Carolyn | Myers | Tampa | FL | 2025-04-13 | |
| 14 | 1382 | Sarah | Foster | Miami | FL | 2025-04-26 | search |
| 15 | 1408 | Susan | Castillo | Tampa | FL | 2025-05-11 | |
| 16 | 1415 | Jamal | Phillips | Miami | FL | 2025-05-13 | search |
| 17 | 1430 | Owen | Morales | Orlando | FL | 2025-05-19 | |
| 18 | 1435 | Jose | Davis | Orlando | FL | 2025-05-22 | search |
| 19 | 1438 | Gabriela | Morales | Tampa | FL | 2025-05-22 | N/A |
| 20 | 1482 | Luke | Kim | Tampa | FL | 2025-06-15 | podcast |
| 21 | 1494 | Natalie | Lopez | Tampa | FL | 2025-06-18 | podcast |
| 22 | 1497 | Janet | Vasquez | Miami | FL | 2025-06-21 | |
| 23 | 1501 | Christina | Flores | Orlando | fl | 2025-06-23 | friend |
| 24 | 1520 | Robert | Myers | Orlando | FL | 2025-07-08 | friend |
| 25 | 1545 | Kyle | Williams | Miami | FL | 2025-07-24 | search |
| 26 | 1564 | Jamal | James | Miami | FL | 2025-08-03 | N/A |
| 27 | 1577 | Pamela | Graham | Orlando | FL | 2025-08-11 | tiktok |
| 28 | 1598 | Mary | Brown | Miami | FL | 2025-08-25 | search |
| 29 | 1607 | Christina | Phillips | Jacksonville | FL | 2025-08-31 | search |
| 30 | 1626 | Ava | Green | Jacksonville | FL | 2025-09-06 | tiktok |
| 31 | 1644 | John | Reyes | Tampa | FL | 2025-09-12 | podcast |
| 32 | 1646 | Ethan | Jackson | tampa | FL | 2025-09-14 | |
| 33 | 1660 | Natalie | Bennett | Miami | FL | 2025-09-22 | N/A |
| 34 | 1661 | Lauren | Morgan | Miami | FL | 2025-09-23 | podcast |
| 35 | 1676 | Edward | Lewis | tampa | FL | 2025-09-28 | |
| 36 | 1687 | Brenda | Anderson | Miami | FL | 2025-10-07 | |
| 37 | 1695 | Henry | Butler | Orlando | FL | 2025-10-10 | N/A |
| 38 | 1720 | Megan | Nguyen | Miami | FL | 2025-10-25 | N/A |
| 39 | 1757 | Jennifer | Harris | Jacksonville | FL | 2025-11-06 | podcast |
| 40 | 1765 | Ava | Henderson | Miami | FL | 2025-11-08 | |
| 41 | 1771 | Logan | Perez | Tampa | FL | 2025-11-10 | podcast |
| 42 | 1773 | Olivia | Myers | Orlando | FL | 2025-11-11 | search |
| 43 | 1802 | Joseph | Anderson | Tampa | FL | 2025-11-18 | google_ads |
| 44 | 1806 | Priya | Parker | Tampa | FL | 2025-11-21 | N/A |
| 45 | 1810 | Stephanie | Carter | MIAMI | FL | 2025-11-21 | N/A |
| 46 | 1829 | Noah | Marshall | Jacksonville | FL | 2025-11-26 | search |
| 47 | 1883 | Elizabeth | Walker | Tampa | FL | 2025-12-02 | friend |
| 48 | 1892 | Larry | Cox | Tampa | FL | 2025-12-04 | |
| 49 | 1897 | Marcus | Wallace | Jacksonville | FL | 2025-12-06 | N/A |
| 50 | 1914 | Helen | Richardson | Miami | FL | 2025-12-10 | N/A |
| 51 | 1972 | Edward | Brooks | Jacksonville | FL | 2025-12-23 | N/A |
| 52 | 1981 | Sandra | Bennett | Orlando | FL | 2025-12-26 | |
| 53 | 1982 | Carolyn | Hudson | Tampa | FL | 2025-12-26 | |
| 54 | 1988 | Jerry | Mendoza | Orlando | FL | 2025-12-28 | N/A |
Loading the editor…
Reference solution
Mote checks your result
Press Check. Mote fills in your answer and compares it with what the report needs.
What Brittany gets, and why
The lesson
A report can only be as clean as its data. Brittany wants to count customers per city, and with
Tampa, tampa and tampa in the same column, a visual would show three Tampas. This level
is the clean-up pass you’ll run on almost every export.
The practice editor
As in the rest of this chapter, you work in a practice editor built for this site: Power Query’s step names and results, one step per line, the table after each step in the preview. In Power BI Desktop the same steps live in Home → Transform data, recorded under Applied Steps in the Query Settings pane.
Look before you clean
Power Query helps you find the problems. On the View tab, tick Column quality (valid,
error and empty percentages under each header), Column distribution (distinct and unique
values) and Column profile (value counts for the selected column). By default they profile
the first 1,000 rows; click the text in the status bar to switch to the entire data set. Here,
Column profile on city lists Tampa, tampa and tampa as separate values: the first sign
of trouble.
Types first
The export wrote every column as text. The icon left of each header shows the type: ABC for
text, 123 for whole number, a calendar for date. Text IDs sort as 1001, 11, 2, and text dates
can’t be filtered by month.
Change type: customer_id to whole number
Change type: signup_date to date
In Power BI: click the type icon on the header, or Transform → Data Type. Power Query writes a Changed Type step:
Table.TransformColumnTypes(Source, {{"customer_id", Int64.Type}, {"signup_date", type date}})
Clean the text
Trim: city, state
Capitalize each word: city
Uppercase: state
All three are under Transform → Format (select the columns first; Ctrl+click selects
several). Trim removes spaces at the start and end, Clean (in the same menu) removes
invisible control characters, Capitalize Each Word writes Tampa and St. Petersburg, and
UPPERCASE writes FL. The M for the first one:
Table.TransformColumns(#"Changed Type", {{"city", Text.Trim, type text}, {"state", Text.Trim, type text}})
Missing is not a value
N/A looks like a referral source called “N/A”. In a chart it would get its own bar, and a count
of known sources would include it. Replace it with a real missing value:
Replace values: referral_source "N/A" with null
In Power BI: select the column, Transform → Replace Values, Value To Find N/A, Replace
With null. Power Query compares the whole cell, case-sensitively, so n/a would need its
own step.
Order of steps
Steps run top to bottom, each on the previous step’s result. Trim before you compare or deduplicate on a text column; change types before you filter by date. If a step was added in the wrong place, drag it up or down in Applied Steps, or right-click → Delete Until End to start again from there.
Common mistakes
- Fixing the visual instead of the data. Renaming one bar doesn’t fix the next refresh.
- Uppercasing a city.
TAMPAis consistent but hard to read; proper case is the convention. - Typing values over cells. Power Query has no cell editing; every fix is a recorded step, and that’s what makes it repeat on refresh.
Lantern lit!
Practised: power querychange typetrimcapitalize each worduppercasereplace valuesdata quality
- Solved
- No hints
- First run
