Search code examples
reporting-servicesssrs-2012ssrs-tablixreportbuilder3.0

Can't get my conditional formatting correct for background color. I've done the math and my expression has to be flawed


I am creating a matrix as follows This is to show how many calls our IT Call Center receives, which building they are coming from and which times we receive the most calls. Here is what I'm getting when I run the report. My formula for the background color is as follows:

=iif(   Count(Fields!RequestNumber.Value)/Sum(Count(Fields!Day.Value)) < 0.016, "Lime" , iif(    Count(Fields!RequestNumber.Value)/Sum(Count(Fields!Day.Value)) >= 0.016 AND Count(Fields!RequestNumber.Value)/Sum(Count(Fields!Day.Value)) <=0.04, "Yellow" , iif(    Count(Fields!RequestNumber.Value)/Sum(Count(Fields!Day.Value)) > 0.04 , "Red" ,"Transparent")))

The 0.016 and 0.04 are the numbers I was given by my boss to use for percentages. Where the problem seems to be is the Sum(Count(Fields!Day.Value)) that I am dividing by. I want that number to be the total number of calls in the entire matrix (not including the total columns obviously), but since they are in matrix columns they aren't giving me the right total even though the expression is the same as the "TotalOfWhole" value (the value I'm trying to divide by) or the bottom right value of the matrix. Any advice? All help will be much appreciated.


Solution

  • You have to refer to your dataset in your total count expression (current cell requests vs total of requests)

     =Count(Fields!RequestNumber.Value)/Count(Fields!RequestNumber.Value,"YourDatasetName")