Search code examples
reporting-servicesssrs-tablix

SSRS check if row group contains a row with a certain cell value


Using Reporting Services, I'm looking to check if the rows in a Tablix contains a column with any cell that contains a certain value. If it doesn't, I want to show an additional row at the bottom of the table.

For example, if the data had these values

Column A Column B Column C
Area 1 Issue 1 Value 1
Area 2 Issue 2 Value 2

I'd want to check if Column A had the value Area 2, and if it didn't, I'd want to display an additional row at the bottom of the table with static values (not values from the report query).

Is this something that can be done?

Thank you


Solution

  • You should be able to do this.

    In summary you need to add a row to the bottom of the row group then set it's Hidden property to an expression that will check the data within the same row group.

    The expression will look something like this.

    "Row Visibility"/"Hidden" Property:

    = SUM(IIF(Fields!ColumnA.Value = "Area 2", 1, 0)) >0
    

    This will look at each row in the group, and add 1 for every instance of "Area 2". Then we check if that SUM >0 . This will return True if it is greater than zero which will therefore hide the row. If no instances are found then the sum returns 0 and therefore false and the row will not be hidden.