Expression.Error:我们不能应用操作员+到类型持续时间和数字
我正在尝试在计划的数据日期完成计划的%启动/结束日期完成,使用if function
if ([Plan_Actual_Start_Date]> [Data Date]) then 0 else ((([Data Date]-[Plan_Actual_Start_Date])+1/(([Plan_Actual_Finish_Date]-[Plan_Actual_Start_Date])+1)))
我得到一个错误如下
如何克服此错误?
I am trying to get Planned % complete on data date from Planned Start/Finish Date using if function
if ([Plan_Actual_Start_Date]> [Data Date]) then 0 else ((([Data Date]-[Plan_Actual_Start_Date])+1/(([Plan_Actual_Finish_Date]-[Plan_Actual_Start_Date])+1)))
I get an error as below
How can I overcome this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
数据类型在电源查询中很重要。
当您从另一个日期中减去一个日期时,结果是持续时间数据类型。
为了在持续时间内添加一个数字,您可以首先将持续时间转换为数字。
将您的公式段修改为以下内容:
duration.days([数据日期] - [plan_actual_start_date])+1
Datatypes are important in Power Query.
When you subtract one date from another, the result is a duration data type.
In order to add a number to a duration, you can first convert the duration to a number.
Modify your formula segments to something like:
Duration.Days([Data Date]-[Plan_Actual_Start_Date]) +1