title: Cumulative Total Headcount Past 12 Months
body: <p>I have the below measure which calculates the headcount. I would like to create a new measure which calculates the running total for the past 12 months.</p>
  <p>TIA</p>
  <pre><code>Employee Count = 
  VAR selectedDate = MAX('Date'[Date])
  RETURN
  SUMX('Table1',
  VAR employeeStartDate =  [DATE_OF_EMPLOYMENT]
  VAR employeeEndDate = [DATE_OF_LEAVING]
  RETURN IF(employeeStartDate &lt;= selectedDate &amp;&amp; 
  OR(employeeEndDate &gt;= selectedDate, employeeEndDate=BLANK()
  ),1,0)
  )
  </code></pre>