Search code examples
reporting-servicesssrs-2012ssrs-expression

SSRS Cell Colour Dependent on Another Cell Value


I'm trying change a cell background colour depending on another cell value, or if the cell value has zero I want a dash like this "-".

This is the formula I'm using, and currently the cell I want to have the dash in when the other cell is at Zero is showing 0.00

=IIF(Fields!RateAmount.Value = 0,"-",(switch(Fields!PercentageDifference.Value <= -10, "Red",
Fields!PercentageDifference.Value >= 10, "Red", True, "Green")))

When searching on here all I can find is an answer for googlesheets, if you do know of a post, please fele free to let me know!

Any help would be very well received! Cheers all


Solution

  • I'm not sure you can change the background color in the same expression you're putting the dash "-".

    I would try to change your expression with =IIF(Fields!RateAmount.Value = 0,"-","(other text when it's not a dash)")

    Then, in properties of your cell, go to BackgroundColor and put something like =switch(Fields!PercentageDifference.Value <= -10, "Red", Fields!PercentageDifference.Value >= 10, "Red", True, "Green")