title: SSAS (Tabular) / DAX - Calculate measure over time / Rolling distinct count
body: <p>I've a question about a rolling distinct count. I'm trying to calculate the latest 30 weeks (210 days) from a specific date (eg. Specific date = 18-02-2019 distinct count from 23-07-2018). </p>
  
  <p>I've found a website/blog where this is explained, <a href="https://radacad.com/datesinperiod-vs-datesbetween-dax-time-intelligence-for-power-bi" rel="nofollow noreferrer">https://radacad.com/datesinperiod-vs-datesbetween-dax-time-intelligence-for-power-bi</a>. But in some weird way, my calculation is not working. 
  My DAX expression: </p>
  
  <pre><code>Aantal mutaties afgelopen 30 weken:= 
  CALCULATE(
      DISTINCTCOUNT(FCT_KlantReis_Mutatie[Mutatie]);
  DATESINPERIOD(
     FCT_KlantReis_Mutatie[Mutatiedatum];
      LASTDATE(FCT_KlantReis_Mutatie[Mutatiedatum])  ;-210;DAY)
  )
  </code></pre>
  
  <p>But in Excel (and PowerBI) I get the following result: </p>
  
  <p><a href="https://i.stack.imgur.com/2ensa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2ensa.png" alt="enter image description here"></a></p>
  
  <p>The table is linked to a date dimension. My guess is that it must be posible, but how...</p>
  
  <p>Thanks in advance for the help.  </p>