简体   繁体   English

舍入时间,Power Bi

[英]ROUNDDOWN TIME, Power Bi

I am looking at using the ROUNDDOWN function.我正在考虑使用ROUNDDOWN函数。

I want to ROUNDDOWN time in all transactions made in a specific hours throughout the day.我想在一天中的特定时间进行的所有交易中进行ROUNDDOWN时间。 Say there were 15 transactions between 9:00 am and 9:59 am.. 9:01:02am, 9:10:05am, 9:45:52am etc.. All rounddown to 9:00:00am or 9:00am so I can measure day by the hour.假设在上午 9:00 到 9:59 之间有 15 笔交易。上午 9:01:02、上午 9:10:05、上午 9:45:52 等。所有四舍五入到上午 9:00:00 或上午 9:00 所以我可以按小时计算一天。

I have tried我试过了

= ROUNDDOWN(Query[TIME], 1) //which messes up the result



= ROUNDDOWN(Query[TIME], "1:00") //which gives me an error, cannot convert value

The time is in H:mm:ss时间在H:mm:ss

If you are doing this in PowerBI with DAX you can use HOUR to extract the only the hour-part from a time-column:如果您在 PowerBI 中使用 DAX 执行此操作,则可以使用HOUR从时间列中提取唯一的小时部分:

TIME(HOUR(Query[TIME]);0;0)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM