title: How to get the latest values of a column per each distinct value of another column in DAX
body: <p>I am eager to create a calculated column in Power BI using DAX.
  From my table in the form of</p>
  
  <pre><code>projects   valid_date    target
  2M         03/24/2019    0.9
  3D         03/25/2019    1
  5K         03/25/2019    0.9
  2M         03/26/2019    0.9
  3D         03/26/2019    0.5
  5K         03/24/2019    0.6
  ...        ...           ...
  </code></pre>
  
  <p>I look to generate a cloumn that holds the value for target, but only if it is the one of the latest "valid_date" for each distinct project.</p>
  
  <p>The result ("latest_target") should look like this:</p>
  
  <pre><code>projects   valid_date    target    latest_target
  2M         03/24/2019    0.9       NULL
  3D         03/25/2019    1         NULL
  5K         03/25/2019    0.9       0.9
  2M         03/26/2019    0.9       0.9
  3D         03/26/2019    0.5       0.5
  5K         03/24/2019    0.6       NULL
  ...        ...           ...       ...
  </code></pre>
  
  <p>What would the DAX formula look like for such a column? I have already tried out some formulas, but as I lack translating my T-SQL ideas into DAX effectively, I don't think it would be helpful to share these here.</p>