title: 2nd latest Date - DAX
body: <p>I have a dataset of users who log into an app.  I want to find the # of days between their last two logins.  I have the DAX expression to get their last login (latest date)</p>
  
  <pre><code>=CALCULATE(Max([Date]),ALL(Table1),Table1[Name]=EARLIER(Table1[Name]))
  </code></pre>
  
  <p>But now I'd like to get their 2nd to last login, and subtract the two. I see some posts about the 2nd to last login, but it puts a blank if there are only two logins, whereas I want the number of days between these as well.</p>