title: SSRS Changing Row Colors Based on Groups?
body: <p>I have a report in SSRS and I am trying to change the background color based on a group. I have 3 groups: YearMonth, Portfolio, and Name. I want to change the color of every other portfolio group. Inside each portfolio group I want all rows to be the same color.</p>
  
  <p>I have tried the following expressions and it fails when there are odd number of portfolios in a given month, ie I don't want the same colors touching.</p>
  
  <pre><code>=IIF(RunningValue(Fields!Portfolio.Value, CountDistinct, "MonthYear") Mod 2, "Gainsboro", "White")
  </code></pre>
  
  <p>The above gets: </p>
  
  <pre><code>YearMonth   Port# (Color)
  Sep-11      Port1 (Gainsboro)
              Port2 (White)
  Aug-11      Port1 (Gainsboro)
              Port2 (White)
              Port3 (Gainsboro)
  Jul-11      Port1 (Gainsboro)
  </code></pre>
  
  <p>I want:</p>
  
  <pre><code>YearMonth   Port# (Color)
  Sep-11      Port1 (Gainsboro)
              Port2 (White)
  Aug-11      Port1 (Gainsboro)
              Port2 (White)
              Port3 (Gainsboro)
  Jul-11      Port1 (White)
  </code></pre>