Forum Discussion

willayd's avatar
willayd
Icon for Advocate I rankAdvocate I
5 years ago
Solved

How 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...
  • Fowmy's avatar
    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 🙂

    YouTube  LinkedIn