title: How to Use NOT IN Query in PowerBI DAX
body: <p>I have imported <strong>Order</strong> table from SQL into PowerBI</p>
  <p>Order Table has Data Like below.</p>
  <pre><code>ID   OrderNo   CustomerNo    OrderDate
  1      DC001      1001       2020-06-01
  1      DC002      1002       2020-06-09
  1      DC003      1003       2020-06-10
  </code></pre>
  <p><strong>Note:</strong> I want to Execute below Query in PowerBI DAX</p>
  <pre><code>Select Count(Distinct CustomerNo) 
  From [order] where orderdate &gt;= '2020-06-08' and orderdate &lt;= '2020-06-14' 
  And CustomerNo 
  Not in (select CustomerNo from [order] where orderdate &lt; '2020-06-08')
  </code></pre>
  <p>I have tried below code in DAX</p>
  <pre><code>MEASURE NOT IN = 
  VAR indexList =SELECTCOLUMNS (
      FILTER('Order','Order'[OrderDate] &gt; [RangeFromDate]),&quot;Distict&quot;, DISTINCTCOUNT ('Order'[CustomerNo]))
  RETURN
      SUMMARIZE (
      FILTER('Order',
          NOT ('Order'[CustomerNo]) IN indexList),
          &quot;Count&quot;,Count ( 'Order'[CustomerNo] )
      )
  </code></pre>
  <p>Note: <em>[RangeFromDate]</em> is MEASURE dynamically load From date from the slicer.</p>
  <p>But Not Working for me.
  Kindly Help me to solve this in PowerBI DAX</p>