title: Power BI(DAX)- Create measure to count distinct rows filtered by condition
body: <p>I have below <code>Customer Transactions</code> data. In a month, customer may buy one or multiple times data pack ,or may not buy data pack.</p>
  <p>Irrespective of how many times data purchased in a month by a customer. I'm trying to find number of months that each customer purchased the data.
  <a href="https://i.stack.imgur.com/GH4au.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GH4au.png" alt="enter image description here" /></a></p>
  <p><code>Total Subscribed Months</code> is expected column.</p>
  <p>Since customer may buy <code>Data Subscribed (GB)</code> more than once in a month. First I'm calculating <code>Total Data Purchased</code> in a month by customer.</p>
  <pre><code>Total Data Purchased = CALCULATE(
                      SUM('Customer Transactions'[Data Subscribed (GB)]),
                          ALLEXCEPT('Customer Transactions','Customer Transactions'[Account Number],'Customer Transactions'[Date])
      )
  
  </code></pre>
  <p>Second, Calculate number of months customer purchased the data pack.</p>
  <pre><code>Total Subscribed Months = 
  CALCULATE(
              DISTINCTCOUNT('Customer Transactions'[Account Number] ),
              'Customer Transactions'[Total Data Purchased]&gt;0
              )
  </code></pre>
  <p>But its not working. Please advise how to correct formulae ?</p>