Getting multiple error results in a column called "Birthdate" in Power Query (From a CSV) when I try to change the Column type from "Text" to "Date".

Shubham Jain 0 Reputation points
2026-11-10T05:27:50.8266667+00:00
  1. Picture1.pngI am learning a course from Maven Analytics on LinkedIn called "Excel Business Intelligence: Power Pivot, DAX and Data Modeling" by Maven Analytics and Chris Dutton.
  2. I have downloaded their exercise files and there's one CV file called customer_lookup. When I transform it in Power query and try to change the birthdate column from type "text" to "date" , I see multiple error results. If I select any of the error values, i see error description as below - "DataFormat.Error: We couldn't parse the input provided as a Date value. Details: 8/26/1961"
  3. I suspect that I live in India and my date format for the system is DD-MM-YYY, and the file I downloaded has the Date format MM-DD-YYYY , its showing these errors.
  4. I want to know how to go about successfuPicture1.pnglly changing the format of the column from Text to Date without getting any errors for valid date values as well.
Microsoft 365 and Office | Excel | For home | Windows
0 comments No comments

1 answer

Sort by: Most helpful
  1. AI answer

    2026-11-10T05:28:30.46+00:00

    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

    1. 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 Birthdate conversion, or recreate those other conversions afterward.
    2. Right-click the Birthdate column heading.
    3. Select Change Type → Using Locale.
    4. In Change Column Type with Locale, choose:
      • Data Type: Date
      • Locale: English (United States)
    5. 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:

    1. Select the converted Birthdate column.
    2. Open Add Column.
    3. Use the Date commands to extract Day, Month, and Year into temporary columns.
    4. Confirm that the source value 8/26/1961 produces:
      • Month: 8
      • Day: 26
      • Year: 1961
    5. 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

    1. Data types in Power Query
    2. Table.TransformColumnTypes
    3. Date.FromText
    4. How culture affects text formatting
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.