Last Modified Date: 12 Apr 2023
- Tableau Desktop
- Tableau Server
Depending on which totals should be hidden the solution will vary. The workbook in the right-hand pane of this article uses the sample data set Superstore to demonstrate all of the following solutions.
All solutions start from the "original" worksheet. Directions to create "original" are in the workbook.
Scenario 1: Remove subtotals for a dimension
Option 1: Tableau Desktop OnlyIn a view that has the three dimensions Category, Sub-category, and Segment on the Rows shelf, display subtotals only for Category.
- Select Analysis > Totals > Add All Subtotals.
- To remove unwanted subtotals, right-click Sub-Category on the Rows shelf and then uncheck Subtotals.
Please note: The videos may have been created in an older version.
Option 2: Tableau Desktop or Web Edit
- Add only the dimensions that you want subtotals for to the view.
- Select Analysis > Totals > Add All Subtotals.
- Add any additional desired dimensions to the view.
Scenario 2: Hide total values for a measureIn a view with the measures Sales and Profit, display total values only for Sales. These steps only work in Tableau Desktop, and there is not currently a web-authoring alternative.
- Right-click Profit on the Measure Values card and select Total Using > Hide.
Scenario 3: Hide total value for dimension valueIn a view with subtotals for Category and Sub-Category, hide total values for specific dimension values. Note, the total row or column will still show as a blank row.
- Select Analysis > Create Calculated Field.
- In the Calculated Field dialog box that opens, do the following, and then click OK:
- Name the calculated field. In this example, the calculated field is named "Sales (hide some total values)"
- In the formula field, create a calculation similar to the following:
IF MIN([Segment]) != MAX([Segment]) //TRUE for all total rows for segment or higher in the view hierarchy AND MIN([Sub-Category]) = MAX([Sub-Category]) //TRUE for all rows in view except totals for sub-category or higher in the view hierarchy AND MIN([Sub-Category]) IN ('Bookcases','Appliances') //list subtotals to hide THEN NULL ELSEIF MIN([Sub-Category]) != MAX([Sub-Category]) AND MIN([Category]) = MAX([Category]) AND MIN([Category]) = 'Furniture' THEN NULL ELSE SUM([Sales]) END
- Create a calculated field with a name like "Profit (hide some total values)" with almost the same calculation as [Sales (hide some total values)] except returning SUM([Profit]) instead of SUM([Sales]), similar to:
IF MIN([Segment]) != MAX([Segment]) AND MIN([Sub-Category]) = MAX([Sub-Category]) AND MIN([Sub-Category]) IN ('Bookcases','Appliances') THEN NULL ELSEIF MIN([Sub-Category]) != MAX([Sub-Category]) AND MIN([Category]) = MAX([Category]) AND MIN([Category]) = 'Furniture' THEN NULL ELSE SUM([Profit]) END
- Drag Sales (hide some total values) on top of SUM(Sales) on the Measure Values card to replace it.
- Drag Profit (hide some total values) on top of SUM(Profit) on the Measures Values card to replace it.
Scenario 4: 'Remove' subtotal for dimension valueThis solution makes it look like the view on the dashboard does not have a subtotal row for Furniture by creating two worksheets and combining them on the dashboard.
Create multiple worksheets
- Right-click the tab for the "Original" worksheet and select Duplicate.
- Rename the duplicate worksheet to "Other".
- Drag Category to the Filter shelf.
- In the Filter dialog, check everything except Furniture and click OK.
- Right-click the tab for the Other worksheet and select Duplicate.
- Rename the duplicate worksheet to Furniture.
- Right-click Category on the Filters shelf and select Edit.
- In the Filter dialog, select only Furniture and click OK.
- Navigate to Analysis > Totals > Remove all Subtotals.
- Navigate to Analysis > Totals > uncheck Show Column Grand Totals.
Create and format dashboard
- Create a new dashboard.
- Add a vertical layout container to the dashboard.
- Add the Furniture and Other worksheets inside of the vertical layout container.
- Click Furniture on the dashboard so it has the selected gray outline, and navigate to Layout in the left-hand pane.
- Open the Outer Padding menu in the Layout pane and adjust the bottom padding to zero.
- Repeat steps 4-5 to set the top outer padding for "Other" to zero.
- In the left-hand pane, navigate to the Dashboard tab.
- In the Size menu, increase the height until neither view has vertical scrollbars.
- "Add All Subtotals" only adds subtotals to the dimensions currently in the view.
- To enable "Add All Subtotals" use more than one dimension in your view.
Totals are currently at the field level. To voice your support for the inclusion of toggling totals at the dimension value level in a future product release, add your vote to the following Community Idea: Option to eliminate subtotalling single rows