A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Convert Birthdate with Change Type → Using Locale → Date → English (United States) so Power Query interprets 8/26/1961 as month/day/year rather than using the Indian system locale.
Convert the column in Power Query
- In Applied Steps, delete the existing Changed Type step that produced the errors.
- If that step also converted other columns, select its gear icon and remove only the
Birthdateconversion, or recreate those other conversions afterward.
- If that step also converted other columns, select its gear icon and remove only the
- Right-click the Birthdate column heading.
- Select Change Type → Using Locale.
- In Change Column Type with Locale, choose:
- Data Type:
Date - Locale:
English (United States)
- Data Type:
- Select OK.
Power Query Desktop normally uses the operating-system regional format when interpreting text. Using Locale overrides that behavior for this conversion, which is appropriate when a CSV uses a different date convention.^1^
8/26/1961 should now become a genuine date value representing 26 August 1961. The way it is subsequently displayed can follow workbook or regional formatting; the underlying year, month, and day remain the converted date components.
Equivalent M code
The UI operation normally creates a culture-explicit step like this:
let
PreviousStep = #"Promoted Headers",
ConvertedBirthdate =
Table.TransformColumnTypes(
PreviousStep,
{{"Birthdate", type date}},
"en-US"
)
in
ConvertedBirthdate
Replace #"Promoted Headers" with the actual preceding step name in the query. Table.TransformColumnTypes accepts an optional culture such as "en-US" for type conversion.^2^
For a conversion that explicitly declares the expected text pattern, use Date.FromText:
let
PreviousStep = #"Promoted Headers",
ConvertedBirthdate =
Table.TransformColumns(
PreviousStep,
{{"Birthdate",
each Date.FromText(_, [Format="M/d/yyyy", Culture="en-US"]),
type date}}
)
in
ConvertedBirthdate
Date.FromText supports both Format and Culture options.^3^ Use this version only if the CSV consistently uses slash-separated US dates such as 8/26/1961.
Verify the result
To verify that ambiguous values such as 1/2/1961 were interpreted correctly:
- Select the converted Birthdate column.
- Open Add Column.
- Use the Date commands to extract Day, Month, and Year into temporary columns.
- Confirm that the source value
8/26/1961produces:- Month:
8 - Day:
26 - Year:
1961
- Month:
- Remove the temporary verification columns.
If errors remain after the locale-aware conversion, inspect only those rows. They likely do not conform to the selected US date convention—for example, blank-like text, malformed values, or another date pattern—and should not be silently converted until their actual source format is identified.
Changing the workbook-wide regional setting is unnecessary for this column. If all imported data in the workbook uses US conventions, the broader setting is available at Power Query Editor → File → Options and settings → Query options → Current Workbook → Regional Settings, but the per-column Using Locale conversion is safer when only this CSV requires US parsing.^4^
References