This article was generated with AI assistance. The examples use synthetic data. The expected dates were checked with a local date-parsing fixture; the M expression follows Microsoft’s documented transformation syntax.
An invoice import can produce zero conversion errors and still shift an invoice into the wrong month. In a source where the agreed format is day/month/year, 03/04/2026 means April 3. A parser assuming month/day/year can accept the same text as March 4. Both values look like valid dates downstream.
Keep the source text available for review
Import the raw date column as text. Remove an automatically generated Changed Type step if it already interpreted the column. Duplicate the raw column and convert the copy using the locale specified for that export. In Excel Power Query, the column control is Change Type > Using Locale. An explicit conversion can look like this:
let
Source = #table(type table [RawDate = text], {
{"03/04/2026"},
{"13/04/2026"}
}),
WithParsedDate = Table.DuplicateColumn(Source, "RawDate", "InvoiceDate"),
Parsed = Table.TransformColumnTypes(WithParsedDate, {{"InvoiceDate", type date}}, "en-GB")
in
Parsed
If different suppliers use different formats, apply the rule for each known source before combining their typed columns. Unknown-source rows belong in a review queue. An AI extraction workflow should carry the original string and the source format rule in separate fields, so the rule remains inspectable after parsing.
Include a test that detects a plausible wrong date
| Raw text | Expected with day first | Expected with month first |
|---|---|---|
| 03/04/2026 | 2026-04-03 | 2026-03-04 |
| 13/04/2026 | 2026-04-13 | Conversion error |
The second row catches an obvious mismatch. The first catches a silent one. In a production acceptance check, I would assert both expected dates, count source and output rows, and keep conversion errors visible with the original source and row ID. Only a confirmed format policy justifies converting ambiguous rows.
Sources: Microsoft Support on locale settings and Microsoft Learn on Table.TransformColumnTypes.
Top comments (0)