У меня возникли проблемы при расчете финансовых отклонений по странам, при воспроизведении общей суммы для каждой страны.
Мои показатели и финансовый год с ИЮНЯ - МАЯ
YTD Budget =
CALCULATE (
SUM ( 'Data'[Expenses] );
AND (
Data[Period]
>= IF ( MONTH (TODAY()) >= 6; MONTH (TODAY()) - 5; MONTH (TODAY ()) + 3 )
- 4;
Data[Period]
<= IF ( MONTH (TODAY()) >= 6; MONTH (TODAY()) - 5; MONTH (TODAY ()) + 3 )
- 1
);
Data[Scenario] = "Budget";
ALLEXCEPT ( DATA; Data[Scenario] )
)
YTD Actual =
CALCULATE (
SUM ( 'Data'[Expenses] );
AND (
Data[Period]
>= IF ( MONTH (TODAY()) >= 6; MONTH (TODAY()) - 5; MONTH (TODAY ()) + 3 )
- 4;
Data[Period]
<= IF ( MONTH (TODAY()) >= 6; MONTH (TODAY()) - 5; MONTH (TODAY ()) + 3 )
- 1
);
Data[Scenario] = "Actual";
ALLEXCEPT ( DATA; Data[Scenario] )
)
YTD Var = [YTD Budget] - [YTD Actual] = 1,307
YTD Var % =
IF (
[YTD Budget] = 0,
0,
( [YTD Budget] - [YTD Actual] )
/ ABS ( [YTD Budget] )
)
Мой набор данных
Department Country Class Scenario Month Fiscal Year Expenses
HR Chile Salary Actual Jun FY-2018 8837
HR Chile Salary Actual Jul FY-2018 6288
HR Chile Salary Actual Aug FY-2018 6096
HR Colombia Salary Actual Jun FY-2018 6187
HR Colombia Salary Actual Jul FY-2018 6547
HR Colombia Salary Actual Aug FY-2018 7613
HR Chile Salary Budget Jun FY-2018 6062
HR Chile Salary Budget Jul FY-2018 7491
HR Chile Salary Budget Aug FY-2018 6689
HR Colombia Salary Budget Jun FY-2018 7191
HR Colombia Salary Budget Jul FY-2018 8466
HR Colombia Salary Budget Aug FY-2018 6976
YTD- Actual: 41,568.00
YTD- Budget: 42,875.00
Ожидаемый результат:
Country Var($) Var%
Chile -979
Colombia 2,286