Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi
I have datetime field in my data where datatype of that field is text and value looks like number. I want to convert this in to Date-Time.
How I can do this.
value
1630000827000
Thansk & regards,
aditya vighne
Solved! Go to Solution.
@adityavighne , I added this number to a new power bi table(enter data) and was able to create a new custom column in power query
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQzNgACCyNzIKkUq4MhEgsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each #datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [Column1]/1000))
in
#"Added Custom"
@amitchandak no this is not working giving an error
Error: We cannot convert the value "1630000827000" to type Function.
@adityavighne , I added this number to a new power bi table(enter data) and was able to create a new custom column in power query
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQzNgACCyNzIKkUq4MhEgsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each #datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [Column1]/1000))
in
#"Added Custom"
@adityavighne , Try a new column power query
#datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [timestamp]/1000)
or
#datetime(1900, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [timestamp]/1000)
User | Count |
---|---|
101 | |
90 | |
85 | |
74 | |
67 |
User | Count |
---|---|
114 | |
103 | |
100 | |
72 | |
64 |