KNOWLEDGE BASE

How To Make Filter Actions Work For Measure Names Using Parameter


Published: 07 Dec 2020
Last Modified Date: 19 Apr 2023

Question

Is it possible to use a measure (instead of dimensions) as a source for filter action?
 

Environment

  • Tableau Desktop 2020.2.7

Answer

  • Build the Bar Chart
  1. Create a new worksheet Bar Chart
  2. Drag Order Date to Columns
  3. Drag Measure Names to Filters card, select Sales and Profit
  4. Drag Measure Values to Rows
  5. Drag Measure Names to the Color of Marks Card
  6. Change the chart type to Bar
  • Build the Details crosstab
    1. Create a new worksheet Details
    2. Create a parameter Measure Names Parameter as the following:User-added image
    3. Create calculation field Selected Profit
      if [Measure Names Parameter]="Profit"
      then [Profit]
      END
      Create calculation field Selected Sales
      if [Measure Names Parameter]="Sales"
      then [Sales]
      END
    4. Drag Order Date to Columns
    5. Drag Measure Names to Filters card, select Selected Sales and Selected Profit
    6. Drag Measure Values to Text in Marks card
    7. Drag Measure Names Parameter, Category, Sub-Category to Rows
  • Set up dashboard actions
    1. Create a dashboard, add Bar Chart and Details to the view
    2. Select from the menu bar, Dashboard>Actions...>Add Action>Change ParameterUser-added image
    3. Click the Use as Filter button User-added image of the Bar Chart
    4. Edit the generated filter, change the Clearing the selection will: to Exclude all valuesUser-added image
Did this article resolve the issue?