Short answer: start each request with the verb (remove, split, replace, merge, change type), name the column, and say what must stay unchanged: "Split the FullName column into FirstName and LastName at the last space; keep every other column as it is." Ask for the result as Power Query steps (M code) instead of a cleaned file, so the cleaning runs again on next month's data and you can read every step.
"Clean this data" lets the AI decide what clean means, and it may change more than you wanted. "Trim the spaces in Customer, keep every other column as it is" changes one thing. The shape is always the same: one verb, one target, and a line about what stays.
Which verbs map to which step?
| Verb | Example request | Power Query step |
|---|---|---|
| Remove | Remove rows where OrderID is blank | Table.SelectRows |
| Remove duplicates | Remove duplicate rows by OrderID, keep the first | Table.Distinct |
| Split | Split FullName at the last space | Table.SplitColumn |
| Replace | Replace "N/A" with null in Region | Table.ReplaceValue |
| Trim | Trim spaces in CustomerName | Table.TransformColumns with Text.Trim |
| Change type | Make OrderDate a date, using the en-GB locale | Table.TransformColumnTypes |
| Merge | Merge Orders with Customers on CustomerID, left outer | Table.NestedJoin |
What does one request look like?
In Power Query (M), on the table Orders:
1. Remove rows where OrderID is blank.
2. Trim spaces in CustomerName.
3. Change OrderDate to a date using the en-GB locale (dates are written 31/12/2026).
Keep all other columns and their order unchanged.
Return the steps as M code I can paste into the Advanced Editor, one step per line.Numbering the steps gives you one applied step each in Power Query, so you can click through them and see what each one did.
Why steps and not a cleaned file?
- They run again. Next month's export goes through the same steps on refresh.
- You can read them. Each applied step shows its result in the preview.
- No data leaves. You describe the columns; the data never has to go into the chat.
What goes wrong?
- No locale on dates. "03/04/2026" is March in one country and April in another.
- "Clean this up." The AI decides what dirty means. Name each step.
- Removing rows silently. Before a Remove step, count the rows it removes and check they are the ones you meant.
Where can you check this?
- Microsoft Learn: Power Query M function reference
- Microsoft Learn: Data types in Power Query, locale when changing types
Where do you start?
Keep the steps foldable to the source where you can: see query folding explained. For the prompt shape behind this, see few-shot prompts.