Forum Discussion

smpa01's avatar
smpa01
Community Champion
4 years ago
Solved

Calculated datetime column in Power Query not DAX

My source data is following   let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtQ1ACGlWB0krpFSbCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t ...
  • Jakinta's avatar
    4 years ago
    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtQ1ACGlWB0krpFSbCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type datetime}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each List.DateTimes( [Column1], 24, #duration(0, 1, 0, 0))),
        #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
        #"Duplicated Column" = Table.DuplicateColumn(#"Expanded Custom", "Custom", "datetime"),
        #"Changed Type2" = Table.TransformColumnTypes(#"Duplicated Column",{{"Column1", type date}, {"Custom", type time}, {"datetime", type datetime}})
    in
        #"Changed Type2"