我正在尝试构建折线图以显示预测的累积总和。我有两个表,一个用于“实际”,一个用于“预测”,都链接到日期表。图表应显示从预测到下个月的实际累计金额。到目前为止,我已经创建了以下措施来获取预测图表:
Chart_Forecast not cumulated =
VAR Actual_Hrs_not_cumulated = CALCULATE([Total Actuals],FILTER(IN_ACTUALS, IN_ACTUALS[Date] <= MAX(CurrentMonth[CurrentMonthParameter])))
VAR Forecast_not_cumulated = CALCULATE([Total Forecast],FILTER(IN_Forecast, IN_Forecast[Date] > MAX(CurrentMonth[CurrentMonthParameter])))
RETURN
IF((SELECTEDVALUE('LT_Reporting Calendar'[Date]) <= MAX(CurrentMonth[CurrentMonthParameter])),Actual_Hrs_not_cummulated, Forecast_not_Cumulated)
这为我提供了非累积的Forcast的折线图,并且可以正常工作。
但是,只要我要根据以下度量在上述度量上建立累积和,就只能得到到当前月份的累积和,而忽略了将来。我认为我有一个过滤器问题。我尝试了许多累积总和的方法,总是得到相同的结果。
Chart_Forcast Cumulated =
CALCULATE(
[Chart_Forecast not cumulated],
FILTER(
ALL('LT_Reporting Calendar'[Date]),
'LT_Reporting Calendar'[Date] <= MAX ('LT_Reporting Calendar'[Date])
)
)
输入:
提前谢谢了
我建议将其写成这样的总和:
Cumulative =
VAR ParameterDate = SELECTEDVALUE ( CurrentMonth[CurrentMonthParameter] )
VAR AxisDate = SELECTEDVALUE ( 'LT_Reporting Calendar'[Date] )
RETURN
CALCULATE (
[Total Actuals],
'LT_Reporting Calendar'[Date] <= AxisDate,
'LT_Reporting Calendar'[Date] <= ParameterDate
) +
CALCULATE (
[Total Forecast],
'LT_Reporting Calendar'[Date] <= AxisDate,
'LT_Reporting Calendar'[Date] > ParameterDate
)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句