title: Alternating row color expression in SSRS matrix not working correctly
body: <p>In the only row group I am trying to get a alternate row color with the following expression:</p>
  
  <p>Expression for background color : <code>=IIf( RunningValue (Fields!SP.Value, CountDistinct, Nothing) MOD 2, "White", "blue")</code></p>
  
  <pre><code>SQL code: 
  
  select
  ROW_NUMBER() OVER (ORDER BY DataDate) AS SSRSRowNumber
  ,datepart(dw,datadate) SSRSDateFilter 
  ,DataDate
  ,SP
  ,sum(TMI) as TotalCI
  from table
  where DataDate&gt;GETDATE()-20
  group by DataDate,SP
  order by 1, 2
  </code></pre>
  
  <p><strong>The result is the picture below, what's wrong in the expression listed above?</strong></p>
  
  <p><a href="https://i.stack.imgur.com/T9Wsn.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T9Wsn.jpg" alt="Example of problem"></a></p>
  
  <p><strong>Edit-</strong>:<a href="http://www.wrox.com/WileyCDA/Section/Report-Solution-Patterns-and-Recipes-Greenbar-Reports.id-291857.html" rel="nofollow noreferrer">Solution</a></p>