title: SSRS 2005 conditional count in chart: how-to?
body: <p>I have a column chart in which I want to display the % of Invoiced Sales in 24 hours and % of Not Invoiced Sales in 24 hours. The data should be categorized by date, so for each date I can see the % of invoiced and not invoiced sales within 24 hours.</p>
  
  <p>My dataset contains: </p>
  
  <ul>
  <li>sales id, </li>
  <li>sales status (only invoiced are permitted and I took care of that in my query), </li>
  <li>date and </li>
  <li><code>nbDays</code>, which is bound to a function that determines if the sale is invoiced in 24h. (if the nbDays &lt; 3 it's in 24h otherwise it's not)</li>
  </ul>
  
  <p>I want my chart to display for each date two column: 1- for invoiced in 24, 2- not invoiced in 24 h. So, I drag the date fields to Category fields area and sales id twice to Data fields area. The idea is to use one for invoiced in 24h and the other is for the other case.</p>
  
  <p>How can I write a conditional expression to get this requirement done and make the data fields sales id displays data according to my condition?</p>
  
  <p>I tried this but it didn't work:</p>
  
  <pre><code>=count(iif(fields!nbDays.value &lt;3, 1,0))  
  </code></pre>
  
  <p>and also the:</p>
  
  <pre><code>=iif(fields!nbDays.value &lt;3, count(fileds!salesid.value),0)
  </code></pre>