当公式只能处理1个值时获取多个值

时间:2018-09-21 21:10:20

标签: powerbi dax powerbi-desktop

选择多个月份和/或年份会发生什么情况

Image 1: What happens when you select multiple months and/or years

错误消息

Image 2: The error message

措施:

Actuals less Forecast = VAR Max_Date = MAX ( 'DateTable'[Date] ) VAR Month_End = EOMONTH ( TODAY (), 0 ) VAR SupplierProjMinusForecast = [Supplier Projected] - [Supplier Forecast] VAR Year_Row = VALUES ( 'DateTable'[Year] ) VAR Year_Today = YEAR ( TODAY () ) VAR Month_Row = VALUES ( 'DateTable'[MonthNumber] ) VAR Month_Today = MONTH ( TODAY () ) VAR Date_Compare =
IF( OR( Year_Row < Year_Today, AND( Year_Row = Year_Today, Month_Row <= Month_Today ) ), SupplierProjMinusForecast, IF( Max_Date <= Month_End, SupplierProjMinusForecast ) ) Return Date_Compare

选择多个月后,此行似乎引起了所有问题。

VAR Month_Row = VALUES ( 'DateTable'[MonthNumber] )

帮助?

0 个答案:

没有答案