Forum Discussion
Sumit_Bhokare
1 year agoRegular Visitor
Date format issue
hello, I need one help on date format. I have a dataset within which date format's are different & want to know is there any way I can correct that within power query. below snapshot of same 0...
- 1 year ago
Try this (using US locale (the date from which you're converting) (the last argument of the Table.TransformColumnTypes) to change both kinds of date successfully):
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrDQNTDUNTIwMlHSAXEMjZA4BpbIHDMIJ1YHpEvfyEgfLqdvZIaTYw7hxMYCAA==", BinaryEncoding.Base64), Compression.Deflate))), ChangedType = Table.TransformColumnTypes(Source,{{"Column1", type date}, {"Column2", type date}, {"Column3", type date}, {"Column4", type date}},"en-US") in ChangedTypeThis:
becomes this:
(I'm in the UK so these dates are showing as dmy, but they're proper dates so will show properly in your locale, that is, they're all August dates)
p45cal
Solution Supplier
1 year agoTry this (using US locale (the date from which you're converting) (the last argument of the Table.TransformColumnTypes) to change both kinds of date successfully):
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrDQNTDUNTIwMlHSAXEMjZA4BpbIHDMIJ1YHpEvfyEgfLqdvZIaTYw7hxMYCAA==", BinaryEncoding.Base64), Compression.Deflate))),
ChangedType = Table.TransformColumnTypes(Source,{{"Column1", type date}, {"Column2", type date}, {"Column3", type date}, {"Column4", type date}},"en-US")
in
ChangedType
This:
becomes this:
(I'm in the UK so these dates are showing as dmy, but they're proper dates so will show properly in your locale, that is, they're all August dates)