CountRows Function (Report Builder and SSRS)
Returns the number of rows in the specified scope, including rows with null values.
You can create and modify report definitions (.rdl) in Report Builder and in Report Designer in SQL Server Data Tools. Each authoring environment provides different ways to create, open, and save reports and related items. For more information, see Designing Reports in Report Designer and Report Builder (SSRS) on the Web at microsoft.com.
CountRows counts all rows in the specified scope, including rows that have null values.
The value of scope cannot be an expression and must refer to the current scope or a containing scope.
For more information about recursive aggregates, see Creating Recursive Hierarchy Groups (Report Builder and SSRS).
The following code example shows an expression that calculates the number of rows in a row group named GroupbyCategory (based on the expression [Category]).
="Number of rows: " & CountRows("GroupbyCategory")