title: Count unique occurrences within a year
body: <p>My database schema looks like down below</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">ID</th>
  <th style="text-align: left;">Date</th>
  <th style="text-align: left;">Status</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">ID1</td>
  <td style="text-align: left;">2022/01/01</td>
  <td style="text-align: left;">Active</td>
  </tr>
  <tr>
  <td style="text-align: left;">ID1</td>
  <td style="text-align: left;">2022/02/01</td>
  <td style="text-align: left;">Active</td>
  </tr>
  <tr>
  <td style="text-align: left;">ID1</td>
  <td style="text-align: left;">2022/03/01</td>
  <td style="text-align: left;">Active</td>
  </tr>
  <tr>
  <td style="text-align: left;">ID1</td>
  <td style="text-align: left;">2022/04/01</td>
  <td style="text-align: left;">Terminated</td>
  </tr>
  <tr>
  <td style="text-align: left;">ID2</td>
  <td style="text-align: left;">2022/01/01</td>
  <td style="text-align: left;">Active</td>
  </tr>
  <tr>
  <td style="text-align: left;">ID2</td>
  <td style="text-align: left;">2022/02/01</td>
  <td style="text-align: left;">Terminated</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I'd like to calculate unique occurrences from start of selected date year, till the selected date. My formula is:</p>
  <p><code>CountOfUnique = CALCULATE( DISTINCTCOUNT( 'Table'[ID] ) , 'Table'[STATUS] = &quot;Active&quot;,  DATESBETWEEN('CALENDAR'[DATE], STARTOFYEAR('CALENDAR'[DATE]), MAX('CALENDAR'[DATE]) ))</code></p>
  <p>In SQL I'd need something like</p>
  <pre><code>SELECT COUNT ( DISTINCT ID) FROM Table
  WHERE STATUS = &quot;ACTIVE&quot;
  AND DATE BETWEEN 2022/01/01 AND 2022/04/01
  </code></pre>