Clean a recurring CSV with Power Query

Set up repeatable cleanup steps for an export with extra spaces and inconsistent types.

Step by step

  1. In Excel for Windows, choose Data → Get Data → From File → From Text/CSV. Select your export and choose Transform Data.
  2. In Power Query, select the name column and apply Trim. Set identifier columns that need leading zeros to Text, and amount columns to a numeric type.
  3. Inspect errors before loading. Choose Close & Load to return the cleaned table to Excel.
  4. Replace the source file with the next export using the same filename and layout. Use Data → Refresh All to repeat the saved transformations. Connectors and refresh options vary by Excel platform.
Microsoft reference

Search ExcelTutor