0
votes

I have a Report where I want to change the background color of the column(sales) based on the Continent column values. Below is the continent column values.
enter image description here

I tried the following expression under Sales column( background color),

=IIF(Fields!column.Value ="4th Quarter",
 SWITCH (
                   Fields!continents.Value ="Asia", "Green",
                   Fields!continents.Value = "N America","LIMEGREEN",
                   Fields!continents.Value ="S America","Yellow",
                   Fields!continents.Value = "Europe", "Red"  
         )
, "Dummy Value")  

When I preview the report, I can see only Green color for all the rows. I know Switch function in SSRS will return the first expression that it finds true.
I also tried by using only IIF condition, still same issue. Is there a way this can be achieved?

1

1 Answers

0
votes

Have you tried something like the following?

=IIF((Fields!column.Value ="4th Quarter") AND (Fields!continents.Value ="Asia"),"Green",
     IIF((Fields!column.Value ="4th Quarter") AND (Fields!continents.Value = "N America"),"LIMEGREEN",
        IIF((Fields!column.Value ="4th Quarter") AND (Fields!continents.Value ="S America"),"Yellow",
            IIF((Fields!column.Value ="4th Quarter") AND (Fields!continents.Value = "Europe"), "Red",
            "Dummy Value"))))