title: a measures for comparing two values and counting the result in Power BI
body: <p>How can I write a measure to count the number of userID for which <strong>sum(x1)</strong> is equal to <strong>count(order_id)</strong>, in Power BI?</p>
  <p>For example, my data table is:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>userID</th>
  <th>x1</th>
  <th>order_id</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>141</td>
  <td>1</td>
  <td>719</td>
  </tr>
  <tr>
  <td>172</td>
  <td>0</td>
  <td>616</td>
  </tr>
  <tr>
  <td>172</td>
  <td>0</td>
  <td>189</td>
  </tr>
  <tr>
  <td>172</td>
  <td>0</td>
  <td>2211</td>
  </tr>
  <tr>
  <td>172</td>
  <td>0</td>
  <td>317</td>
  </tr>
  <tr>
  <td>1103</td>
  <td>1</td>
  <td>98</td>
  </tr>
  <tr>
  <td>1103</td>
  <td>1</td>
  <td>213</td>
  </tr>
  <tr>
  <td>1103</td>
  <td>1</td>
  <td>15</td>
  </tr>
  <tr>
  <td>2524</td>
  <td>0</td>
  <td>4902</td>
  </tr>
  <tr>
  <td>2524</td>
  <td>1</td>
  <td>3620</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>and I use table visual of power bi for this, to explain my mean:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>userID</th>
  <th>sum(x1)</th>
  <th>count(order_id)</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>141</td>
  <td>1</td>
  <td>1</td>
  </tr>
  <tr>
  <td>172</td>
  <td>0</td>
  <td>4</td>
  </tr>
  <tr>
  <td>1103</td>
  <td>3</td>
  <td>3</td>
  </tr>
  <tr>
  <td>2524</td>
  <td>1</td>
  <td>2</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Note that the userID column is one of the columns in my data table, and calculating sum(x1) and count(order_id) in this sample is by Power BI default features.</p>
  <p>The result for this sample should be 2. I need a measure that returns 2.</p>