title: create a countif measure not impacted by filter in visual in powerBI
body: <p>Need help in creating measures that will reflect the actual count of rows in the table when filtered.</p>
  <p>Example:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ID</th>
  <th>RankC</th>
  <th>RankA</th>
  <th>Avg Diff</th>
  <th>RankC_count</th>
  <th>RankA_count</th>
  <th>Avg Diff_count</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1000</td>
  <td>AAA</td>
  <td>XYZ</td>
  <td>+01.00 to  +01.25</td>
  <td>5</td>
  <td>6</td>
  <td>4</td>
  </tr>
  <tr>
  <td>1001</td>
  <td>AAA</td>
  <td>ZY1</td>
  <td>+01.5.00 to  +01.75</td>
  <td>5</td>
  <td>1</td>
  <td>5</td>
  </tr>
  <tr>
  <td>1002</td>
  <td>AAB</td>
  <td>XYZ</td>
  <td>+01.5.00 to  +01.75</td>
  <td>3</td>
  <td>6</td>
  <td>5</td>
  </tr>
  <tr>
  <td>1003</td>
  <td>AAB</td>
  <td>ZY2</td>
  <td>+01.5.00 to  +01.75</td>
  <td>3</td>
  <td>1</td>
  <td>5</td>
  </tr>
  <tr>
  <td>1004</td>
  <td>AAB</td>
  <td>XYZ</td>
  <td>+01.00 to  +01.25</td>
  <td>3</td>
  <td>6</td>
  <td>4</td>
  </tr>
  <tr>
  <td>1005</td>
  <td>AAA</td>
  <td>XYZ</td>
  <td>+01.00 to  +01.25</td>
  <td>5</td>
  <td>6</td>
  <td>4</td>
  </tr>
  <tr>
  <td>1006</td>
  <td>AAA</td>
  <td>ZY3</td>
  <td>+01.00 to  +01.25</td>
  <td>5</td>
  <td>1</td>
  <td>4</td>
  </tr>
  <tr>
  <td>1007</td>
  <td>AAC</td>
  <td>XYZ</td>
  <td>+01.25.00 to  +01.5</td>
  <td>1</td>
  <td>6</td>
  <td>2</td>
  </tr>
  <tr>
  <td>1008</td>
  <td>AAA</td>
  <td>ZY4</td>
  <td>+01.25.00 to  +01.5</td>
  <td>5</td>
  <td>2</td>
  <td>2</td>
  </tr>
  <tr>
  <td>1009</td>
  <td>AAZ</td>
  <td>ZY4</td>
  <td>+01.5.00 to  +01.75</td>
  <td>1</td>
  <td>2</td>
  <td>5</td>
  </tr>
  <tr>
  <td>1010</td>
  <td>ABY</td>
  <td>XYZ</td>
  <td>+01.5.00 to  +01.75</td>
  <td>1</td>
  <td>6</td>
  <td>5</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>The last 3 columns represent the count of each entry.  If I use the measure such as below, it provides the correct count.  However, when I use in the visual, filtering by ID, say ID 1000, I want it to show line 1 with 5,6, and 4 on the counts, instead of all 1.</p>
  <p><strong>Questions:</strong></p>
  <ol>
  <li>Is there any measure to give me the correct result?  say summarize the table first then do a lookup?</li>
  <li>is creating a column the only choice?  I cannot create columns since I need 1000 of these calculated columns.  whereas using measure, I can create 1000 in one go.</li>
  </ol>
  <p>Thanks for any help.</p>
  <pre><code>AverageDiff_Count =
  CALCULATE (
      COUNTROWS (
          FILTER ( '28Jun_1973', [Average Diff] = '28Jun_1973'[Average Diff] )
      )
  )
  </code></pre>