Power Query Course
Lab 03

Parsing Dates & Regional Settings

Learn why simply changing a column to Date type can go wrong, how regional settings affect date interpretation, and how the Parse function gives you cleaner, safer results.

~25 minutes
Level: Beginner
Tool: Microsoft Excel

Concept

Date columns are one of the trickiest parts of data cleaning. Raw files often contain non-date values mixed in — like "TOTAL" rows — that Power Query can silently misinterpret when you apply a Date type conversion. The result looks correct at first glance but contains wrong data that will corrupt your analysis downstream.

This lab also introduces regional settings — the locale Power Query uses to decide what date format to expect (e.g. MM/DD/YYYY vs DD/MM/YYYY). Instead of the standard type-change button, you'll use Transform → Date → Parse, which is more explicit and converts only values that genuinely match a date pattern, leaving everything else as an error you can then filter out safely.

Lab File — pq1c.csv Start fresh with a new query in the same workbook from the previous labs.
Download File
Lab Instructions
# Steps Directions
1 Create a new query and reference CSV File 1C. Home New Source File Text/CSV
2 Change the Source step so that it doesn't specify number of columns. Delete Columns=19, from the formula bar.
3 Delete 4 unwanted header rows from CSV data. Home Remove Rows Remove Top Rows
4 Identify correct headers from the data. Home Transform Use First Row as Headers
5 Delete Ref1, Ref2 and Metric columns. Click column header Home Remove Columns
6 Highlight Store & Cat columns, and unpivot the rest. Transform Unpivot Columns Unpivot Other Columns
7 Rename Attribute & Value columns as Date and Sales, respectively. Double-click on the column headers to rename them.
8 Before we start working with dates, check your date region settings. File Options Query Options This File Regional Settings English (Canada)
9 Try it first: Change the Date column to Date type by clicking the ABC datatype icon next to its name. Notice that in row 17, the 2017 TOTAL value is incorrectly interpreted as a date. We don't want this — delete this step.
10 Instead, use the Parse function to interpret dates. Transform Date Parse
11 Filter out the error rows and change the data types of Store and Cat to Whole Number.
12 Rename the query to this slide's title. This step will not be mentioned in future exercises.
Why Parse instead of Change Type? The standard "Change Type → Date" converts every value in the column, including text like "TOTAL" — producing wrong dates silently. Parse only succeeds on values that genuinely look like dates, turning everything else into a visible error you can filter away with confidence.
Power Query Course · askfarouk.net Ahmed Farouk — Microsoft Certified Trainer