简体   繁体   English

如何在 Power Bi 中将毫秒转换为 DateTime?

[英]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.我有一张有 13 位时间戳(我相信毫秒)的表,但由于某种原因我无法在 Power Bi 中转换它们。 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) (这是来自转换数据和添加自定义列之后)

在此处输入图像描述

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.任何帮助,将不胜感激。

The problem is likely that your [Created] column is formatted as text.问题可能是您的[Created]列被格式化为文本。

Try converting that column to a numerical type before writing a custom column that tries to divide by 1000.在编写尝试除以 1000 的自定义列之前,尝试将该列转换为数字类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Pandas 中,如何将字符串转换为以毫秒为单位的日期时间对象? - In Pandas, how to convert a string to a datetime object with milliseconds? 如何使用JavaScript将人类可读的小时数转换为毫秒? - How do I convert human readable hours into milliseconds using javascript? 如何将 Unix 时间戳(以毫秒为单位)转换为与 PostgreSQL 兼容的时间戳? - How do I convert Unix timestamp in milliseconds to a Timestamp compatible with PostgreSQL? 如何在 Redshift 中将时间戳(具有毫秒)转换为 EPOCH - How do I convert Timestamp (having milliseconds) to EPOCH in Redshift 如何在 Power BI 中为累积计数创建列? - How can I create a column for cumulative count in Power BI? 如何在Perl中将log4j时间戳转换为毫秒? - How can I convert a log4j timestamp to milliseconds in Perl? 如何在PHP中将秒转换为毫秒 - How to convert seconds to milliseconds in PHP 如何更新 firebird 时间戳字段以删除毫秒部分? - How do I update a firebird timestamp field to remove milliseconds part? 如何将字符串日期时间列转换为 R 中的日期时间列? - How can I convert a string datetime column to a datetime column in R? 如何在 kotlin 编程中将毫秒转换为时间戳 - How to convert milliseconds to timestamp in kotlin programming
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM