title: How to write a measure in power bi to count items based on their status as of selected date
body: <p>I cannot think of a solution for this:
  I have a table with the following columns:
  <code>Employee id, hired date, fired date, current_status</code>.
  <br/><code>current_status</code> is a conditional column showing status of employee for a current date i.e. if fired date is blank the status is "working", else the status is "fired".</p>
  
  <p>I want to create a measure, which would show count of employees by their status as of end of selected month.</p>
  
  <p>E.g an employee's current status may be "fired", but as of end of June 2019 his status was "working", so in the context of previous date he should be counted as working.</p>