LightClub.
Menu
Explore the blog

Power Query Date Locale: Fix Swapped Days and Months

A date that looks valid may already be wrong. Learn how to convert date strings using the source locale and check the actual day and month.

lightclub_owner6 min read
Power Query date locale example: synthetic UK text 04/07/2026 interpreted as day 4, month 7 and 2026-07-04.

A Power Query date locale mismatch can turn 04/07/2026 into April 7 when the source means July 4. Set the culture used to interpret the original text, then verify the resulting day and month.

Example verification: These are synthetic examples with expected results. The steps have been reviewed against documentation but not yet tested in Power Query.

Changing how an already-converted date is displayed will not repair an incorrect date value. Go back to the original text and convert it with the locale used by the source.

Identify the source date format first

Ask the person or system that produced the file which date convention it uses. You can also inspect the export documentation and dates where the day exceeds 12. Do not guess from a single ambiguous value.

Consider this synthetic export, which is explicitly documented as using day/month/year:

Original textIntended date (ISO)
04/07/20262026-07-04
19/07/20262026-07-19
12/01/20262026-01-12

The first and third entries could be interpreted incorrectly without causing a visible error. The second is a useful diagnostic because there is no nineteenth month. A successful import alone does not demonstrate that all dates are correct.

Set the Power Query Date Locale for the Source Text

  1. Open the query in Power Query Editor.
  2. In Applied Steps, inspect Changed Type and other conversion steps. Find the last step where the affected column still contains the original strings.
  3. Remove or edit the incorrect automatic date conversion, preserving other necessary transformations. For a complex query, work on a duplicate first.
  4. From the original text column, right-click the header and choose Change Type > Using Locale. The exact menu labels may vary by host or version.
  5. Choose Date as the type and English (United Kingdom) as the locale for this day/month/year example.
  6. Confirm the conversion and check both ambiguous and unambiguous rows.

For a US month/day/year file, choose English (United States) instead. The locale should describe the incoming values, not necessarily the country where you are working. Microsoft documents this distinction between interpreting values and displaying them [1].

Reproduce the conversion with M code

You can create a blank query and paste the following example into Advanced Editor. This creates a separate copy of the input text so that you can compare it against the converted date.

let
    Source = #table(type table [RawDate = text], {
        {"04/07/2026"},
        {"19/07/2026"},
        {"12/01/2026"}
    }),
    Copy = Table.DuplicateColumn(Source, "RawDate", "ParsedDate"),
    Typed = Table.TransformColumnTypes(
        Copy, {{"ParsedDate", type date}}, "en-GB"
    ),
    Checked = Table.AddColumn(
        Typed, "Day", each Date.Day([ParsedDate]), Int64.Type
    ),
    Result = Table.AddColumn(
        Checked, "Month", each Date.Month([ParsedDate]), Int64.Type
    )
in
    Result

Table.TransformColumnTypes accepts a culture parameter for interpreting text [2]. Here, en-GB expresses the source convention explicitly. The day and month columns provide a check independent of the display format.

The expected checks are:

RawDateDayMonth
04/07/202647
19/07/2026197
12/01/2026121

Why your dates may still look different

A correct date value might be shown as 7/4/2026 in a US-formatted interface. If the extracted day is 4 and the month is 7, the underlying value is July 4. That is a presentation difference rather than a parsing mistake.

What if the source mixes date formats?

A single locale is not a reliable solution for a column that combines US and UK conventions. Some strings, such as 04/07/2026, are impossible to disambiguate from their text alone. Use a trustworthy source-system identifier to route each row to the correct conversion, or ask for a new export using an explicit format such as YYYY-MM-DD. Review invalid or uncertain values rather than replacing them with guessed dates.

If the original file already contains incorrectly converted dates, obtain a fresh export. Changing the locale on the damaged values cannot reliably reconstruct what was intended.

Final check before refreshing a report

Keep the original strings during validation, compare known dates with the source, and inspect conversion errors. Only then remove temporary check columns if you no longer need them. This is particularly important when the dates determine reporting periods or which customer record is considered latest.

When the source specifies an exact date format

If a source guarantees a fixed representation, use an explicit format and culture in the parsing expression. For example, Date.FromText on the text 04/07/2026 with Format set to dd/MM/yyyy and Culture set to en-GB expresses both assumptions. With an ISO export, use the documented yyyy-MM-dd shape instead. Date.FromText supports this options record. Leaving Format unspecified allows best-effort interpretation, which is less informative when you’re diagnosing a new source. [3]

Choose the Power Query date locale from the specification for each source. A trusted source identifier can tell you which parser to use when you append files from different systems. An ambiguous date cannot tell you that on its own. If the provider allows both padded and unpadded dates, test the exact accepted representations before imposing a single strict format. Keep the original value alongside the parsed date so later QA can recover the input.

Raw value   04/07/2026. UK source   2026-07-04. US source   2026-04-07.
The source’s format gives the context that an ambiguous string lacks.

Keep conversion errors in a reviewable exception list

Make three groups in your practice data: valid ambiguous dates, valid dates with day numbers above 12, and impossible dates. For a UK day-first export, use 04/07/2026, 19/07/2026 and 31/02/2026. Expect July 4, July 19 and a parse error. Check that empty cells are handled according to the source contract. A blank meaning “no date supplied” is distinct from a string that claims an impossible date.

In Power Query, use a duplicated query or a separate check column to examine errors. The M try expression can expose whether a conversion failed and return error details. Save enough source context to identify the original record. Replacing failed conversions with today’s date or silently dropping those rows can produce misleading reporting periods. [4]

After parsing, filter a small sample to the month it is supposed to land in and compare the count to the source. Repeat once on an older export and again when the provider changes its format. If the day and month disagree even though there were no errors, investigate the first transformation that changed the original text.

04/07/2026    4 July. 19/07/2026    19 July. 31/02/2026    Review error.
A valid ambiguous date and an impossible date exercise different checks.

Sources

[1] Microsoft Learn, Data types in Power Query: https://learn.microsoft.com/en-us/power-query/data-types

[2] Microsoft Learn, Table.TransformColumnTypes: https://learn.microsoft.com/powerquery-m/table-transformcolumntypes

[3] Microsoft Learn, Date.FromText: https://learn.microsoft.com/en-us/powerquery-m/date-fromtext

[4] Microsoft Learn, Error handling in Power Query: https://learn.microsoft.com/en-us/power-query/error-handling

Keep your curiosity switched on.

Explore more practical guides and ideas from LightClub.

About LightClub

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep reading.

All articles