title: PowerBI DAX for Finding Last Record
body: <p><strong>Question</strong></p>
  <p>What is an efficient way to create a calculated column finding the last value of my <code>DATE</code> column, using the <code>ModifiedOn</code> column, per <code>ID</code>? I don't want the MAX date, just the last record (even if the last record is the minimum). Also, my table is a calculated column.</p>
  <p><strong>Example Table</strong></p>
  <p>ID
  DATE
  ModifiedOn</p>
  <p>A
  2/4/2020
  1/16/2019</p>
  <p>A
  2/5/2020
  1/17/2019</p>
  <p>B
  3/2/2020
  2/7/2020</p>
  <p>B
  3/3/2020
  2/8/2020</p>
  <p>B
  3/1/2020
  2/9/2020</p>
  <p><strong>Current Formula</strong></p>
  <pre><code>LastRecord = 
  VAR Max_Date =
  CALCULATE (
      MAX ( 'Table1'[ModifiedOn] ),
      ALLEXCEPT ( 'Table1', 'Table1'[ID] )
   )
  
  RETURN
  IF (
      Table1[ModifiedOn] = Max_Date,
      Table1[DATE]
      )
  </code></pre>
  <p><strong>Current Results</strong></p>
  <p>But using the formula I get a calculated column that looks like this:
  I keep getting blanks where they should be filled with the LAST recorded date of that ID.
  <a href="https://i.stack.imgur.com/VhfXp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VhfXp.png" alt="enter image description here" /></a></p>