let
Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
Output = Table.AddColumn(Source, "Date", each
#date(Number.FromText("20" & Text.Range([TextDate],0,2)), Number.FromText(Text.Range([TextDate],3,2)),Number.FromText(Text.Range([TextDate],6,2)))),
Type = Table.TransformColumnTypes(Output,{{"Date", type date}})
in
Type
Book2 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | TextDate | TextDate | Date | |||
2 | 21.03.10 | 21.03.10 | 3/10/2021 | |||
3 | 20.04.12 | 20.04.12 | 4/12/2020 | |||
4 | 19.12.08 | 19.12.08 | 12/8/2019 | |||
Sheet5 |
When I test that it swaps the dd and yy. But will work if the century is prepended to the TextDate. For the example above using the Date.FromText approach:You could also try:
Date.FromText([TextDate], "en-GB")
let
Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
Output = Table.AddColumn(Source, "Date", each Date.FromText("20" & [TextDate]))
in
Output