Forum Discussion

C3Jacks18's avatar
C3Jacks18
Regular Visitor
3 years ago
Solved

Date/Time/Timezone Issue

Good morning,  I am new to Microsoft BI and learning the tool now. I uploaded three data files and combined them and I have a date columns that look like this: 01/29/2019 11:03 PM CST I just want t...
  • v-yueyunzh-msft's avatar
    3 years ago

    Hi , C3Jacks18 

    According to your description, you just want the Date in your text. Right?

    I think you need to solve it in your Power Query Editor. You can use the Text.Split()  to realize it.

    You can put this M code in "Advanced Editor" to refer to :

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtQ3stQ3MjC0VDA0tDIwVgjwVXAODlGK1QFJGUNkDEysTAxQZZA04ZQyQJOyhJkHlDFGkzEyAUoZGSoYGCFLxQIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Item Revision Date" = _t]),
        test = Table.TransformColumnTypes(Source,{{"Item Revision Date", type text}}),
        Custom1 = Table.TransformColumns(test,{"Item Revision Date",(x)=> try Date.From(Text.Split(x," "){0})  otherwise null    }),
        #"Changed Type" = Table.TransformColumnTypes(Custom1,{{"Item Revision Date", type date}})
    in
        #"Changed Type"

    Then we can meet your need:

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly