Conditoinal Formatting on Percent Field Not Working

  • Alright, I'm feeling really dumb having to ask this question as i've done this a thousand times, however I can't seem to get this to work and it's driving me crazy.

    I have a field containing metrics which are formatted to percent with two decimal places. The data type of the field is FLOAT in the database. I'm trying to add conditional formatting so that the text will be red or green depending whether the metric is less than or lower than a certain value. Right now I have this in the color property -

    =SWITCH(SUM(Fields!MyVal.value) > .95, "Green", "Red")

    This doesn't work. I've tried different variations on the numbers including > 0 but the formatting just doesn't work. Obviously i'm not recalling how to do this properly and I know this is easy which is making me further frustrated.

    What am I missing here?

    EDIT: I'm going to edit to say that i've discovered that a nested IIF statement works, but I don't understand why that works and the SWITCH doesn't.

    Thanks!!

  • It is because switch works with expression/object pairs, you need to write it like this

    =SWITCH(SUM(Fields!MyVal.value) > .95, "Green", True, "Red")

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply