title: Powerpivot DAX - How to get the "Second from the Last" date
body: <p>In a dimension table of Period where there is a DateTime column, i need to get the "Second from the Last" date from that table. I need to use the result in a Filter expression which does not allow MAX() function.</p>
  
  <p>I was able to get the lastest date and use it in filter with the following expression:</p>
  
  <p><code>FILTER(PeriodForecastEuro, RELATED(DimPeriod[PeriodDate]) = LASTDATE(VALUES(DimPeriod[PeriodDate])))</code></p>
  
  <p>But I have no idea how to get "the second from the last" and the "third from the last".</p>
  
  <p>I am new to the entire SSAS thing. How should I go about this?</p>