Forum Discussion
Change text date to a date type
- 7 months ago
I used this YouTube video - which I found it to be a great informative resource.
https://www.youtube.com/watch?v=JJFiPtmqPAg
Hi agd50 ,
Please have a look at the code below. Let me know if this is what you required as the end product. Thanks!
Code:
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText("i45WMjA1NDIyMDJVitUBcwyROQZIHANLCCcWAA==", BinaryEncoding.Base64),
Compression.Deflate
)
),
let
_t = ((type nullable text) meta [Serialized.Text = true])
in
type table [Dates = _t]
),
Type = Table.TransformColumnTypes(Source, {{"Dates", type text}}),
DateType = Table.AddColumn(
Type,
"Date",
each #date(
Number.From(Text.End(_[Dates], 4)),
Number.From(Text.End(Text.Start(_[Dates], 4), 2)),
Number.From(Text.Start(_[Dates], 2))
)
),
ChangeLocaleToAus = Table.TransformColumnTypes(DateType, {{"Date", type date}}, "en-AU")
in
ChangeLocaleToAus
Regards,