title: error in Calculate : A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed
body: <p>I have these two tables that are mutually exclusive (not connected in any way) .</p>
  <p>The first table has date , number of customers on the dayDISTINCTCOUNT(sales[user_name]), total sales , tier (calculated measure below )</p>
  <p>The second table is CustomerLimit which is basically consecutive numbers between 1 and 100.</p>
  <pre><code>Tier = VAR Limit = SELECTEDVALUE ( CustomerLimit[CustomerLimit] )
  
  VAR CustCount = COUNT ( sales[user_name] )
  
  RETURN
  
  IF (
  
  ISBLANK ( Limit ), &quot;Select a value&quot;,
  
  IF ( CustCount &gt; Limit, &quot;Good&quot;, &quot;Bad&quot; )
  
  )
  </code></pre>
  <p>Now I need to aggregate YTD the total amount of customers by Tier. I used calculate(DISTINCTCOUNT(sales[user_name]),Tier = &quot;Good&quot;) .</p>
  <p>It give me an error of : A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.</p>
  <p>Can someone please help me with how can I adjust this calculate function to aggregate them?</p>
  <p>Thank you</p>
  <p><a href="https://i.stack.imgur.com/IvgCt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IvgCt.png" alt="enter image description here" /></a></p>