title: Cumulative Total in Power BI- YTD Budget
body: <p>Im working in POWERBI and trying to calculate an YTD Budget Measures for the rolling total of the previous month. </p>
  
  <p>For YTD Budget of 2018 = sum of monthly expenses from Jun to Aug.</p>
  
  <p>My Measure: </p>
  
  <p>YTD Budget = 
  VAR
  MaxPeriod = CALCULATE(MAX('DATA'[PERIOD]),'DATA'[SCENARIO] = "Actual")
  RETURN
  CALCULATE(sum('DATA'[AMOUNT]),'DATA'[SCENARIO] = "Budget", 'DATA'[PERIOD] &lt;= MaxPeriod)</p>
  
  <p>How can I calculate the accumulative month total by YTD Budget? Just, Jun to Aug.</p>
  
  <p><a href="https://i.stack.imgur.com/aAVNL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aAVNL.png" alt="Data"></a></p>
  
  <p>Expected Outcome:</p>
  
  <p>Department Country  Class   Scenario    Month   Fiscal Year  Expenses<br>
  HR          Chile       Salary    Actual    Jun      FY-2018      8837<br>
  HR          Chile       Salary    Actual    Jul      FY-2018      6288<br>
  HR          Chile       Salary    Actual    Aug      FY-2018      6096           </p>
  
  <p>HR          Colombia    Salary    Actual    Jun      FY-2018      6187<br>
  HR          Colombia    Salary    Actual    Jul      FY-2018      6547<br>
  HR          Colombia    Salary    Actual    Aug      FY-2018      7613</p>
  
  <p>HR          Chile      Salary     Budget    Jun       FY-2018     6062<br>
  HR          Chile      Salary     Budget    Jul       FY-2018     7491<br>
  HR          Chile      Salary     Budget    Aug       FY-2018     6689          </p>
  
  <p>HR          Colombia    Salary    Budget    Jun       FY-2018     7191<br>
  HR          Colombia    Salary    Budget    Jul       FY-2018     8466<br>
  HR          Colombia    Salary    Budget    Aug       FY-2018     6976          </p>
  
  <p>YTD- Actual: 41,568.00
  YTD- Budget: 42,875.00</p>
  
  <p>Thank you.</p>