title: How to count number of repeated clients
body: <p>I'm a newbie in PBI. I'm facing a problem with creating measure as below:</p>
  <p><img src="https://i.stack.imgur.com/Su6Rl.png" alt="enter image description here" /></p>
  <p>My task is to fulfill the Mark column with criteria:</p>
  <ul>
  <li><strong>NEW:</strong> For the clients who 1st time order</li>
  <li><strong>Repeat:</strong> From 2nd order in later months and current order date must be 6 days larger than the last order.</li>
  </ul>
  <p>It was done in excel by:</p>
  <pre><code>=IF(
      COUNTIF($B$5:B5,B5)=1,
      &quot;NEW&quot;,
      IF(
          AND(
              COUNTIFS($B$5:B5,B5,$D$5:D5,D5)=1,
              ([@[Order date]]-LARGE(IF($B$5:B5=B5,$C$5:C5),2)&gt;=7)
          ),
          &quot;Repeat&quot;,
          &quot;2nd in Month&quot;
      )
  )
  </code></pre>
  <p>But I don't know how to create in DAX/PQ to get expecting result as:</p>
  <p><img src="https://i.stack.imgur.com/Hs0br.png" alt="enter image description here" /></p>