2
votes

Im working in POWERBI and trying to calculate an YTD Budget Measures for the rolling total of the previous month.

For YTD Budget of 2018 = sum of monthly expenses from Jun to Aug.

My Measure:

YTD Budget = VAR MaxPeriod = CALCULATE(MAX('DATA'[PERIOD]),'DATA'[SCENARIO] = "Actual") RETURN CALCULATE(sum('DATA'[AMOUNT]),'DATA'[SCENARIO] = "Budget", 'DATA'[PERIOD] <= MaxPeriod)

How can I calculate the accumulative month total by YTD Budget? Just, Jun to Aug.

Data

Expected Outcome:

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

Thank you.

1
Can you please post your starting data as text rather than an image?Alexis Olson

1 Answers

0
votes

I have download your data and applied this measure:

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]))

Think I got the results you want for the period between June and August

Or without the filter Data[Scenario]="Actual" or Data[Scenario]="Budget" to have the separate results by each of this records

Table in PowerBI

If is not this that you look please tell me!