|
1 | 1 | --- |
2 | | -title: "Add a Filter to a Dataset (Report Builder)" |
| 2 | +title: Add a filter to a Report Builder dataset |
3 | 3 | description: Learn how to add a filter to a dataset to limit the data in a report after the data is retrieved from an external data source. |
4 | 4 | author: maggiesMSFT |
5 | 5 | ms.author: maggies |
6 | | -ms.date: 03/07/2017 |
| 6 | +ms.date: 08/01/2024 |
7 | 7 | ms.service: reporting-services |
8 | 8 | ms.subservice: report-data |
9 | | -ms.topic: conceptual |
| 9 | +ms.topic: how-to |
10 | 10 | ms.custom: updatefrequency5 |
| 11 | + |
| 12 | +#customer intent: As a Report Builder user, I want to learn how to add filters to my datasets so that I can limit the data in a report that's retrieved from a shared data source. |
11 | 13 | --- |
12 | | -# Add a Filter to a Dataset (Report Builder and SSRS) |
13 | | - 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. |
| 14 | +# Add a filter to a Report Builder dataset |
| 15 | + |
| 16 | +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. |
14 | 17 |
|
15 | 18 | [!INCLUDE [ssrs-report-parts-deprecated](../../includes/ssrs-report-parts-deprecated.md)] |
16 | 19 |
|
17 | | - 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. |
| 20 | +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 another filter that applies only to the instance. |
18 | 21 |
|
19 | | - 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. |
| 22 | +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 isn't supported. |
20 | 23 |
|
21 | 24 | > [!NOTE] |
22 | | -> [!INCLUDE[ssRBRDDup](../../includes/ssrbrddup-md.md)] |
23 | | - |
24 | | -### To add a filter to a shared dataset |
25 | | - |
26 | | -1. Open a shared dataset in shared dataset mode. |
| 25 | +> [!INCLUDE[ssRBRDDup](../../includes/ssrbrddup-md.md)] |
27 | 26 | |
28 | | -2. On the **Home** tab, in the **Shared Datasets** group, click Datasets. The **Dataset Properties** dialog box opens. |
| 27 | +## Add a filter to a shared dataset |
29 | 28 |
|
30 | | -3. Click **Filters**. This displays the current list of filter equations. By default, the list is empty. |
| 29 | +1. Open a shared dataset in Report Builder. |
31 | 30 |
|
32 | | -4. Click **Add**. A new blank filter equation appears. |
| 31 | +1. On the **Home** tab, select **Set Options**. The **Dataset Properties** dialog box opens. |
33 | 32 |
|
34 | | -5. In **Expression**, type or select the expression for the field to filter. To edit the expression, click the expression (*fx*) button. |
| 33 | +1. Select the **Filters** tab. This option displays the current list of filter equations. By default, the list is empty. |
35 | 34 |
|
36 | | -6. From the list box, select the data type that matches the type of data in the expression you created in step 5. |
37 | | - |
38 | | -7. 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. |
| 35 | +1. Select **Add**. A new blank filter equation appears. |
| 36 | + |
| 37 | + :::image type="content" source="../../reporting-services/report-data/media/add-dataset-filter.png" alt-text="Screenshot of the Dataset Properties dialog box on the Filters tab highlighting the add button."::: |
39 | 38 |
|
40 | | -8. In the **Value** box, type the expression or value against which you want the filter to evaluate the value in **Expression**. |
| 39 | +1. In the **Expression** field, enter or select the expression for the field to filter. To edit the expression, select the expression (**fx**) button. |
41 | 40 |
|
42 | | - For examples of filter equations, see [Filter Equation Examples (Report Builder and SSRS)](../../reporting-services/report-design/filter-equation-examples-report-builder-and-ssrs.md). |
| 41 | +1. From the dropdown list, select the data type that matches the type of data in the expression you created in the previous step. |
43 | 42 |
|
44 | | -9. Select **OK**. |
| 43 | +1. In the **Operator** dropdown list, select the operator that you want the filter to use to compare the values in the **Expression** and **Value** field. The operator you choose determines the number of values that are used from the next step. |
45 | 44 |
|
46 | | -### To add a filter to an embedded dataset or a shared dataset instance |
| 45 | +1. In the **Value** field, enter the expression or value against which you want the filter to evaluate the value in the **Expression** field. To edit the value, select the expression (**fx**) button. |
47 | 46 |
|
48 | | -1. Open a report in report design mode. |
| 47 | + For examples of filter equations, see [Filter equation examples in a paginated report (Report Builder)](../../reporting-services/report-design/filter-equation-examples-report-builder-and-ssrs.md). |
49 | 48 |
|
50 | | -2. Right-click a dataset in the **Report Data** pane and then click **Dataset Properties**. The **Dataset Properties** dialog box opens. |
| 49 | +1. Select **OK**. |
51 | 50 |
|
52 | | -3. Click **Filters**. This displays the current list of filter equations. By default, the list is empty. |
| 51 | +## Add a filter to an embedded dataset or a shared dataset instance |
53 | 52 |
|
54 | | -4. Click **Add**. A new blank filter equation appears. |
| 53 | +1. In your report, right-click a dataset in the **Report Data** pane and then select **Dataset Properties**. The **Dataset Properties** dialog box opens. |
55 | 54 |
|
56 | | -5. In **Expression**, type or select the expression for the field to filter. To edit the expression, click the expression (*fx*) button. |
| 55 | +1. Select the **Filters** tab. This option displays the current list of filter equations. By default, the list is empty. |
57 | 56 |
|
58 | | -6. From the drop-down box, select the data type that matches the type of data in the expression you created in step 5. |
| 57 | +1. Select **Add**. A new blank filter equation appears. |
59 | 58 |
|
60 | | -7. 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. |
| 59 | +1. In the **Expression** field, enter or select the expression for the field to filter. To edit the expression, select the expression (**fx**) button. |
61 | 60 |
|
62 | | -8. In the **Value** box, type the expression or value against which you want the filter to evaluate the value in **Expression**. |
| 61 | +1. From the dropdown list, select the data type that matches the type of data in the expression you created in the previous step. |
63 | 62 |
|
64 | | - For examples of filter equations, see [Filter Equation Examples (Report Builder and SSRS)](../../reporting-services/report-design/filter-equation-examples-report-builder-and-ssrs.md). |
| 63 | +1. In the **Operator** dropdown list, select the operator that you want the filter to use to compare the values in the **Expression** and **Value** field. The operator you choose determines the number of values used in the next step. |
65 | 64 |
|
66 | | -9. Select **OK**. |
| 65 | +1. In the **Value** field, type the expression or value against which you want the filter to evaluate the value in the **Expression** field. To edit the value, select the expression (**fx**) button. |
67 | 66 |
|
68 | | -## See Also |
69 | | - [Add Dataset Filters, Data Region Filters, and Group Filters (Report Builder and SSRS)](../../reporting-services/report-design/add-dataset-filters-data-region-filters-and-group-filters.md) |
70 | | - [Expression Examples (Report Builder and SSRS)](../../reporting-services/report-design/expression-examples-report-builder-and-ssrs.md) |
71 | | - [Add a Filter (Report Builder and SSRS)](../../reporting-services/report-design/add-a-filter-report-builder-and-ssrs.md) |
| 67 | + For examples of filter equations, see [Filter equation examples in a paginated report (Report Builder)](../../reporting-services/report-design/filter-equation-examples-report-builder-and-ssrs.md). |
72 | 68 |
|
| 69 | +1. Select **OK**. |
73 | 70 |
|
| 71 | +## Related content |
| 72 | + |
| 73 | +- [Add dataset filters, data region filters, and group filters to a paginated report (Report Builder)](../../reporting-services/report-design/add-dataset-filters-data-region-filters-and-group-filters.md) |
| 74 | +- [Expression examples in paginated reports (Report Builder)](../../reporting-services/report-design/expression-examples-report-builder-and-ssrs.md) |
| 75 | +- [Add a filter to a paginated report (Report Builder)](../../reporting-services/report-design/add-a-filter-report-builder-and-ssrs.md) |
| 76 | + |
0 commit comments