How to: Add a Filter to a Dataset (Report Builder 3.0 and SSRS)
Add a filter to a dataset to limit the data in a report after the data is retrieved from an external data source. When you add a filter to a dataset, all report parts or data regions use only data that matches the filter conditions.
For a shared dataset, a filter that applies to all dependent items must be part of the shared dataset definition on the report server. A report or report part that contains an instance of a shared dataset can create an additional filter that applies only to the instance.
To add a filter, you must specify one or more conditions that are filter equations. A filter equation consists of an expression that identifies the data that you want to filter, an operator, and the value to compare to. The data types of the filtered data and the value must match. Filtering on aggregate values for a dataset is not supported.
Note
You can create and modify report definitions (.rdl) in Report Builder 3.0 and in Report Designer in Business Intelligence Development Studio. 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 3.0 (SSRS) on the Web at microsoft.com.
To add a filter to a shared dataset
Open a shared dataset in shared dataset mode.
On the Home tab, in the Shared Datasets group, click Datasets. The Dataset Properties dialog box opens.
Click Filters. This displays the current list of filter equations. By default, the list is empty.
Click Add. A new blank filter equation appears.
In Expression, type or select the expression for the field to filter. To edit the expression, click the expression (fx) button.
From the list box, select the data type that matches the type of data in the expression you created in step 5.
In the Operator box, select the operator that you want the filter to use to compare the values in the Expression box and the Value box. The operator you choose determines the number of values that are used from the next step.
In the Value box, type the expression or value against which you want the filter to evaluate the value in Expression.
For examples of filter equations, see Filter Equation Examples (Report Builder 3.0 and SSRS).
Click OK.
To add a filter to an embedded dataset or a shared dataset instance
Open a report in report design mode.
Right-click a dataset in the Report Data pane and then click Dataset Properties. The Dataset Properties dialog box opens.
Click Filters. This displays the current list of filter equations. By default, the list is empty.
Click Add. A new blank filter equation appears.
In Expression, type or select the expression for the field to filter. To edit the expression, click the expression (fx) button.
From the drop-down box, select the data type that matches the type of data in the expression you created in step 5.
In the Operator box, select the operator that you want the filter to use to compare the values in the Expression box and the Value box. The operator you choose determines the number of values that are used from the next step.
In the Value box, type the expression or value against which you want the filter to evaluate the value in Expression.
For examples of filter equations, see Filter Equation Examples (Report Builder 3.0 and SSRS).
Click OK.