Last Modified Date: 24 Apr 2023
When a dimension is placed on the Filters shelf, Tableau Desktop filters out the underlying data as well as the data in the view. When using running sum, percent change, or moving average calculations, this filtering will cause only the data in the view to change. Filters based on table calculations do not filter out underlying data. Instead, the data is hidden from the view, allowing dimension members to be hidden from the view without impacting the data available in the view.
Review the steps listed below in the attached package workbook found to the right of this description in the "Attachments" section.
Step 1: Set up the View
- In Tableau Desktop, connect to the Superstore Sales sample data.
- Drag Order Date to Rows.
- Right-click Order Date on Rows, and then select Month.
- Right-click Order Date on Rows again, and then select Discrete.
- Right-click Order Date on Rows again, and then select Sort.
- In the Sort dialog box, under Sort Order, select Descending, and then click OK.
- Drag Sales to Text.
- Right-click Sales on Text, and then select Quick Table Calculation > Moving Average.
Step 2: Filter the View
- Select Analysis > Create Calculated Field to create a calculated field.
- In the Calculated Field dialog box that opens, enter a name for the field. In the example workbook, this field is named Date Lookup Filter.
- In the formula field, create a calculated field similar to the following, and then click OK:
- Under Measures, right-click Date Lookup Filter, and then select Convert to Continuous.
- Drag Date Lookup Filter from Measures to Filters.
- In the Filter dialog box that opens, select the desired dates, and then click OK.
Additional InformationApplying a LOOKUP function to find past GDP works but does not find past values when a date filter is applied to the view. The data will need to be hidden instead of filtered.
Community Forum: How to display a graph of "active events" over time.