Loading

Tableau Actions using Grand Totals Do Not Filter Target Worksheets

Julkaisupäivä: May 7, 2026
Kuvaus

Tableau actions do not run as expected when triggering an action from a grand total or subtotal.

Cause

Grand totals and subtotals are special fields that have unique interactions with actions. Here is the behavior for a filter/parameter/set using the field being totaled when triggering an action from a subtotal:

Filter Action
"Keep filtered values" after clearing selectionAll values selected in filter
"Show all values" after clearing selectionAll values selected in filter
"Exclude all values" after clearing selectionNo values selected in filter

 

Parameter Action updating [Sub-Category Parameter]
"Set value to" after clearing selectionKeep last selected value
"Keep current value" after clearing selectionKeep last selected value

 

Set Action updating [Sub-Category Set]
Running action will "Assign values to set"All values in set selected
Running action will "Add values to set"All values in set selected
Running action will "Remove values from set"Keep last selected value(s)
Ratkaisu

Depending on the desired results, the best solution will vary. Below are some common Tableau use cases, but you can review the Tableau behavior for all action configurations in the Cause section of this article to help build a solution for other use cases.

Scenario 1: Target Worksheet should be filtered to all sub-categories being totaled when clicking on subtotal

Option 1: Use Parameter Actions

Create a calculation that returns the sub-category the user selected, or the name of the category when the subtotal row is clicked. This value can be fed into a parameter because it is not the field being totaled, which will allow us to see which total(s) were selected. 

The attached example workbook uses the sample data set Superstore to demonstrate the following directions. These directions start from "Original Dashboard." Directions to make "Original Dashboard" are embedded in the workbook.

  1. Select Analysis > Create Calculated Field
  2. In the Calculated Field dialog box that opens, do the following, and then click OK:
    1. Name the calculated field. In this example, the calculated field is named "Click History Calc"
    2. In the formula field, create a calculation similar to the following:
      IF MIN([Category]) != MAX([Category])
      THEN 'all'
      ELSEIF MIN([Sub-Category]) != MAX([Sub-Category])
      THEN MIN([Category])
      ELSE MIN([Sub-Category])
      END
      
  3. Drag [Click History Calc] onto Detail on the Marks card
  4. Click the down carrot next to the search bar in the left-hand data pane and select Create Parameter...
  5. In the Create Parameter dialog, do the following and click OK:
    1. Name the parameter "Click History Parameter"
    2. For Data type, select String
    3. For Allowable values, select All
  6. Navigate to Worksheet > Actions...
  7. In the Actions dialog, click Add Action > Change Parameter...
  8. In the Add Parameter Action dialog, do the following and click OK:
    1. Name the action "which rows the user clicked on"
    2. For Source Sheets, select Sample - Superstore from the dropdown menu and check only Scn 1, opt 1: Source Sheets
    3. For Run action on, choose Select
    4. For Target Parameter, select Click History Parameter
    5. For Source Field, select Click History Calc
    6. For Aggregation, select Concatenate
    7. For Clearing selection will, select Set value to and type in none
  9. Create a new worksheet named "Scn 1, opt 1: Target Sheet"
  10. Drag [Sales] onto Text
  11. Create a calculated field with a name like "Scn 1 Opt 1 Filter" with a calculation similar to the following:
    CONTAINS([Click History Parameter], [Sub-Category])
    OR CONTAINS([Click History Parameter], [Category])
    OR CONTAINS([Click History Parameter], 'all')
    OR [Click History Parameter] = 'none'
    
    
  12. Drag [Scn 1 Opt 1 Filter] to the Filters shelf
  13. In the Filter dialog, check True, and click OK

Option 2: Replace totals with discrete measure

Clicking on a header has the expected behavior, but teaching users to not click on totals is not a reliable solution. Instead we can replace the subtotal row with a column that contains the subtotal value.

The attached example workbook uses the sample data set Superstore to demonstrate the following directions. These directions start from "Original Dashboard." Directions to make "Original Dashboard" are embedded in the workbook.

  1. Select Analysis > Create Calculated Field
  2. In the Calculated Field dialog box that opens, do the following, and then click OK:
    1. Name the calculated field. In this example, the calculated field is named "Category Subtotal"
    2. In the formula field, create a calculation similar to the following:
    3. { FIXED [Category] : SUM( [Sales] ) }
  3. Right-click [Category Subtotal] in the data pane and select Default Properties >  Number Format...
  4. In the Default Number Format dialog, do the following and click OK:
    1. Select Number (Custom)
    2. For Decimal places, type in 0
  5. Right-click [Category Subtotal] in the data pane and select Convert to Discrete
  6. Drag [Category Subtotal] to the Rows shelf after [Category]
  7. Navigate to Analysis > Totals > Remove All Subtotals
  8. Navigate to Analysis > Totals > uncheck Show Column Grand Totals
  9. Add "Scn 1, opt 2: Source Sheet" and "Scn 1, opt 2: Target Sheet" to a dashboard
  10. Click the highlight table viz on the dashboard to select it, and then click the filter icon on the gray outline of the viz

 

Scenario 2: Action should not trigger at all when clicking on subtotal

If the desired behavior is to have nothing happen when the user clicks a total, then feeding sub-category values into a parameter action will work consistently.

The attached example workbook uses the sample data set Superstore to demonstrate the following directions. These directions start from "Original Dashboard." Directions to make "Original Dashboard" are embedded in the workbook.

  1. Click the down carrot next to the search bar in the left-hand data pane and select Create Parameter...
  2. In the Create Parameter dialog, do the following and click OK:
    1. Name the parameter "Sub-Category Parameter"
    2. For Data type, select String
    3. For Allowable values, select All
  3. Navigate to Worksheet > Actions...
  4. In the Actions dialog, click Add Action > Change Parameter...
  5. In the Add Parameter Action dialog, do the following and click OK:
    1. Name the action "which sub-categories the user clicked on"
    2. For Source Sheets, select Sample - Superstore from the dropdown menu and check only Scn 2: Source Sheet
    3. For Run action on, choose Select
    4. For Target Parameter, select Sub-Category Parameter
    5. For Source Field, select Sub-Category
    6. For Aggregation, select Concatenate
    7. For Clearing selection will, select Set value to and type in none
  6. Create a new worksheet named "Scn 2: Target Sheet"
  7. Drag [Sales] onto Text
  8. Create a calculated field with a name like "Scn 2 Filter" with a calculation similar to the following:
    CONTAINS([Sub-Category Parameter], [Sub-Category])
    OR [Sub-Category Parameter] = 'none'
  9. Drag [Scn 2 Filter] to the Filters shelf
  10. In the Filter dialog, check True, and click OK
Lisäresurssit

To voice your support for the inclusion of this enhancement in a future product release, add your vote to the following Salesforce Idea: Action Filter on Grand Totals.


Knowledge-artikkelin numero

001473771

Liitteet

Actions on Totals_v2022.1.twbx

1340 KB

 
Ladataan
Salesforce Help | Article