Forum Discussion
willayd
Advocate I
5 years agoHow to Convert Datetime String with Zulu Suffix to Actual Datetime in Power BI?
I am sourcing data from a web service that provides datetime strings in the format of "2020-11-02T09:00:00Z" . I am looking for a built in way to convert these strings to timestamps in Power BI. TIME...
- 5 years ago
willayd
You can change the Data Type to Date/Time in Power Query and it will do the conversion. Paste the below code in na blank query and check please:let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtA1NNI1NA8xMLACoyil2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type datetime}}) in #"Changed Type"________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
Fowmy
Super User
5 years agowillayd
You can change the Data Type to Date/Time in Power Query and it will do the conversion. Paste the below code in na blank query and check please:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtA1NNI1NA8xMLACoyil2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type datetime}})
in
#"Changed Type"________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂