简体   繁体   English

Power BI-从度量获取预测日期

[英]Power BI - Getting a forecast date from a measure

I have a "DaysLeft" measure that I created that contains the number of days (Decimal) left until a specific Plant area is completed. 我创建了一个“ DaysLeft”度量,其中包含直到完成特定工厂区域为止的天数(十进制)。 So for each value in my "PlantArea" column, there is a unique "DaysLeft" measure value. 因此,对于我的“ PlantArea”列中的每个值,都有一个唯一的“ DaysLeft”度量值。

I now want to get the forecast date for when each "PlantArea" will be complete. 我现在想获取每个“ PlantArea”何时完成的预测日期。 Thus, Today()+DaysLeft for that particular plant area. 因此,该特定工厂区域的Today()+ DaysLeft。

I've tried: 我试过了:

DATEADD(TODAY(), +[DaysLeft], DAY)

but that gives me nothing :( 但这没有给我任何东西:(

Any idea how I can do this? 知道我该怎么做吗?

DATEADD() only works for column. DATEADD()仅适用于列。 For measure, you can simply try 对于测量,您可以简单地尝试

Forecast Date = NOW() + [DaysLeft]

NOW() is better than TODAY() for this case as it returns the current datetime instead of just date. 在这种情况下, NOW()TODAY()更好,因为它返回当前日期时间而不是仅返回日期。

Result: 结果:

结果

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

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