title: grouping data for a pie chart in SSRS
body: <p>I have a data set that I use to build a pie chart in ssrs:</p>
  
  <pre><code>&lt;fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" aggregate="true"&gt;
    &lt;entity name="account"&gt;
      &lt;attribute name="bio_employeesworldwide" alias="TotalWorldWideEmployees" aggregate="sum" /&gt;
      &lt;filter&gt;
        &lt;condition attribute="customertypecode" operator="eq" value="2" /&gt;
      &lt;/filter&gt;
   &lt;link-entity name="contact" from="parentcustomerid" to="accountid" alias="contact"&gt;
  
  
      &lt;attribute name="bio_webuseraccountstatus" alias="count_bio_webuseraccountstatus" aggregate="countcolumn" /&gt;
  
      &lt;attribute name="bio_webuseraccountstatus" alias="bio_webuseraccountstatusgroupby" groupby="true" /&gt;
  
    &lt;/link-entity&gt;
    &lt;/entity&gt;
  &lt;/fetch&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/ZGL4N.png" alt="enter image description here"></p>
  
  <p>I would like to have only 2 areas in this pie chart. One area should be all Active and the other should be everything that <code>!="Active"</code></p>
  
  <p>or describe in sql it would be:</p>
  
  <pre><code>Case When "Active" then "Active" else "NotActive". 
  </code></pre>
  
  <p>How do I accomplish this with SSRS?</p>
  
  <p>I've been trying to do this with group expressions for the series:</p>
  
  <p><img src="https://i.stack.imgur.com/uF0MK.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/u5flA.png" alt="enter image description here"></p>
  
  <p>What am I doing wrong? <strong>How do I just get 2 shaded regions?</strong></p>
  
  <p>After attempting the IIF suggestion below, I am getting input string was not in a recognized format:</p>
  
  <p><img src="https://i.stack.imgur.com/pkVwd.png" alt="enter image description here"></p>
  
  <p>Following Kyle's advice, I've changed the formula to:</p>
  
  <pre><code>=
  IIf(Not (IsNothing(Fields!bio_webuseraccountstatusgroupbyValue.Value) 
      OR Fields!bio_webuseraccountstatusgroupbyValue.Value="")
      ,"Active"
          , "InActive")
  </code></pre>
  
  <p>and the result i am getting now is still that silly error message:</p>
  
  <p><img src="https://i.stack.imgur.com/TcXVY.png" alt="enter image description here"></p>
  
  <p>Another failed attempt:</p>
  
  <pre><code>=iif(NOT IsNothing(Fields!bio_webuseraccountstatusgroupbyValue.Value),
  
          Switch(Fields!bio_webuseraccountstatusgroupbyValue.Value&lt;&gt;"InActive" 
          AND Fields!bio_webuseraccountstatusgroupbyValue.Value&lt;&gt;"Active", 
              "InActive", "Active")
  
          ,"InActive")
  </code></pre>
  
  <p>interestingly this time, there's only one error:</p>
  
  <p><img src="https://i.stack.imgur.com/A7lOx.png" alt="enter image description here"></p>
  
  <p>i incorrectly used a string value instead of numeric, so now it is this: </p>
  
  <pre><code>=IIF(NOT IsNothing(Fields!bio_webuseraccountstatusgroupbyValue.Value),
          SWITCH(Fields!bio_webuseraccountstatusgroupbyValue.Value &lt;&gt; 1
                      AND Fields!bio_webuseraccountstatusgroupbyValue.Value&lt;&gt;3, 
                  1,
                  True, 3
          ),1)
  </code></pre>
  
  <p>now i am getting no errors, just an incorrect pie chart:</p>
  
  <p><img src="https://i.stack.imgur.com/UynIf.png" alt="enter image description here"></p>