Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
913 views
in Technique[技术] by (71.8m points)

timestamp - How do I convert milliseconds into DateTime in Power Bi?

I have a table that has 13 digit timestamps (milliseconds I believe) but I can't convert them in Power Bi for some reason. I've looked at many methods online and it should work but I keep getting an error each time I try to convert. (This is from transform data and after adding a custom column)

enter image description here

When I try to convert the timestamps in "created" column into a new custom column I get an error. This is the formulae I use when creating a new column.

#datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [Created]/1000)

This apparently works for other people who have the same problem but not for me and I'm not sure why that is, I just keep getting Errors.

Any help would be appreciated.

question from:https://stackoverflow.com/questions/65861197/how-do-i-convert-milliseconds-into-datetime-in-power-bi

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The problem is likely that your [Created] column is formatted as text.

Try converting that column to a numerical type before writing a custom column that tries to divide by 1000.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...