def get_zero_measure_date(dates, start_date):
  """
  Given a start date returns the date of the measure closest in the past.
  dates: list of sorted datetetime.dates
  start_date: datetime.date
  """

  null_date = min(dates)

  for date in dates:
    if date <= start_date:
      null_date = date

  return null_date