title: PowerBI DAX - Identifying first instance based on multiple criteria
body: <h2>Using DAX to identify first instance of a record</h2>
  
  <p>I'm faced with trying to identify the first instance in a database where someone (identified by the ID column) has purchased a product for the first time. It's possible for said person to purchase the product multiple times on different days, or purchase different products on the same day. I drummed up an excel formula that gets me there, but am having trouble translating into DAX.</p>
  
  <pre><code>=COUNTIFS(ID,ID,PurchaseDate,"&lt;="&amp;PurchaseDate,Product,Product)
  </code></pre>
  
  <p>Which results in the correct values in the "First Instance?" Column.</p>
  
  <p><a href="https://i.stack.imgur.com/m4Jdn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m4Jdn.png" alt="enter image description here"></a></p>
  
  <p>Ideally I won't have to hardcode values, as I would like to use the "Product" column as a parameter in the future. If there are other suggests aside from translating this in DAX, that would also be appreciated! (IE using filters, or other tools in PowerBI)</p>
  
  <p>Thanks in advance!</p>