title: Count number of occurrences in a column
body: <p>I ran a survey of members of different groups (e.g. Group 1 to 4) about whether they agree or disagree with something. I'm attempting to chart these responses in Microsoft PowerBI Desktop.</p>
  
  <p>I have a data model loaded that includes columns like these in a single table:</p>
  
  <pre><code>Group    Question1   Question2
  Group1   Agree       Agree
  Group1   Disagree    Agree
  Group4   Disagree    Disagree
  Group3   Agree       Agree
  Group2   Disagree    Agree
  Group2   Agree       Disagree
  Group4   Agree       Agree
  Group1   Agree       Disagree
  </code></pre>
  
  <p>I'd like to know if there is a DAX that can count the number of occurrences of the words "Agree" and "Disagree" such that I can have those as values on a stacked bar chart (one chart per question):</p>
  
  <pre><code>Group1   Agree---------   Disagree----
  Group2   Agree-------  Disagree-------
  Group3   Agree----------  Disagree----
  Group4   Agree------  Disagree--------
  </code></pre>
  
  <p>(apologies for the ASCII-art)</p>
  
  <p>I've tried using the COUNTA() function but it just keeps returning the number of rows. I've also tried just dragging the question column in as a data field but it again, just makes each bar the same length as they all have the same number of total responses.</p>
  
  <p>Thanks in advance.</p>