Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello. So I am converting epoch time to standard time and date format but I have some cells that are blank and the conversion is returning 1/1/1970. How can i prevent it from doing that. I want it to show a blank if the cell is blank but not 1/1/1970. Here are screen shots of what it is doing and what I have.
So to sum it up. I want to convert cells that only have a value in it only and for it to ignore the blank cells.
Solved! Go to Solution.
Hi @fowl04 ,
Based on your description, I have created a simple sample:
Please try to add a new column:
Here is the M code:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTI0Mzc2tTSAAKVYnWglJ6AomOEMY7jAGK5gDQZmRmZGJlANsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Epoch = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", type text}, {"Epoch", Int64.Type}}),
#"Added Conditional Column" = Table.AddColumn(#"Changed Type", "Custom", each if [Epoch] = null then "" else #datetime(1970,1,1,0,0,0)+#duration(0,0,0,[Epoch]/1000))
in
#"Added Conditional Column"
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @fowl04 ,
Based on your description, I have created a simple sample:
Please try to add a new column:
Here is the M code:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTI0Mzc2tTSAAKVYnWglJ6AomOEMY7jAGK5gDQZmRmZGJlANsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Epoch = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", type text}, {"Epoch", Int64.Type}}),
#"Added Conditional Column" = Table.AddColumn(#"Changed Type", "Custom", each if [Epoch] = null then "" else #datetime(1970,1,1,0,0,0)+#duration(0,0,0,[Epoch]/1000))
in
#"Added Conditional Column"
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
120 | |
74 | |
72 | |
58 | |
50 |
User | Count |
---|---|
167 | |
83 | |
68 | |
66 | |
55 |