title: Creating Calculated Fields in Google Datastudio
body: <p>I would like to create categories based on a count of variable.</p>
  <pre><code> CASE
        WHEN COUNT(variable) = 1 THEN &quot;1&quot;
        WHEN COUNT(variable) = 2 THEN &quot;2&quot;
        WHEN COUNT(variable) = 3 THEN &quot;3&quot;
        WHEN COUNT(variable) = 4 THEN &quot;4&quot;
        WHEN COUNT(variable) &gt;= 5 THEN &quot;&gt;5&quot;
      END
  </code></pre>
  <p>I get an error that says that my formula is not valid. However, I cannot see where the mistake is and Google does not offer help in this regard.</p>