The main idea is to adjust a FormattingRule for a label that represents a summary. Use the Formatting.Visible property to control item visibility and the FormattingRule.Condition property to provide an expression based on your condition.
This example illustrates the latter approach. An aggregate function of the following format is used in the example:
"[Collection][Condition].Sum("Field")"
The Sum function summarizes all "Field" values that match the Condition.
For further information, see:
How to: Calculate an Aggregate Function.
Criteria Language Syntax
How to: Conditionally Suppress Controls