tombomcom
tombomcom

Reputation: 87

Tablix column formatting values

I have a tablix with several columns. One of columns has discount percentage values. I want to change the font to white if all of the rows have value 0, and if some of the cells have different value, I want all the values to apperar black.

I have set the Font Color value to:

=IIF(SUM(Fields!Discount.Value)=0, "White", "Black")

When all columns are 0, everything shows up white.

The problem is when some of the values are not 0, they show up black, but the 0 values are white and there are empty cells.

Upvotes: 2

Views: 477

Answers (1)

Ian Preston
Ian Preston

Reputation: 39566

If you're using this expression in the detail row of the Tablix, you might need to add a Scope paremeter to your Sum clause, something like:

=IIF(SUM(Fields!Discount.Value, "DataSet1")=0, "White", "Black")

This is because the Sum will execute in the current Scope unless another is specified, so your expression will only consider the current row. Adding the scope as above will consider all rows in the Dataset.

Upvotes: 2

Related Questions