Group expression examples in paginated reports (Report Builder)
Applies to: Microsoft Report Builder (SSRS) Power BI Report Builder Report Designer in SQL Server Data Tools
In a data region in a paginated report, you can group data by a single field, or create more complex expressions that identify the data on which to group. Complex expressions include references to multiple fields or parameters, conditional statements, or custom code. When you define a group for a data region, you add these expressions to the Group properties. For more information, see Add or Delete a Group in a Data Region (Report Builder and SSRS).
To merge two or more groups that are based on simple field expressions, add each field to the group expressions list in the group definition.
You can create and modify paginated report definition (.rdl) files in Microsoft Report Builder, Power BI Report Builder, and in Report Designer in SQL Server Data Tools.
Examples of Group Expressions
The following table provides examples of group expressions that you can use to define a group.
|Group by the
|Group by last name and first name.||
|Group by the first letter of the last name.||
|Group by parameter, based on user selection.
In this example, the parameter
|Group by three separate age ranges:
"Under 21", "Between 21 and 50", and "Over 50".
|Group by many age ranges. This example shows custom code, written in Visual Basic .NET, that returns a string for the following ranges:
25 or Under
26 to 50
51 to 75
Filter, Group, and Sort Data (Report Builder and SSRS)
Expression Examples (Report Builder and SSRS)
Custom Code and Assembly References in Expressions in Report Designer (SSRS)