The Ability to Not Display the Grand Total if Only One Value is Displayed
Published: 13 Apr 2023 Last Modified Date: 13 Apr 2023
Issue
How to not display the grand total if only one record is showing in the visualization.
Example (before workaround):
Desired Behavior:
Environment
Tableau Desktop
Resolution
The workaround can be achieved by overlaying the 2 sheets on a single dashboard. The procedure is described below and available to follow along with the packaged workbook available in the "Attachments" section on the right side of this article.
Procedure Summary
Step 1 - Advance preparation Step 2 - Create a sheet displaying the grand total Step 3 - Create a dashboard
Step 1
1. Connect to the Sample - Superstore data from Tableau Desktop. 2. Drag Category to Rows and Sales to Text on the Marks card. 3. Drag Category to Filters and click OK. 4. Right-click on Category on the Filters pane and select Show Filter.
Step 2
4. Duplicate the sheet created in Step 1. 5. On the toolbar select Analysis > Totals > Show Columns Grand Total 6. Create a new calculated field with the following: Name : Display Control Calculation : IF WINDOW_SUM(COUNTD([Category])) >= 2 THEN TRUE ELSE FALSE END 7. Drag Display Control to Filters and check True and click OK.
8. Right-click on Category on Filters and select Apply to Worksheets -> Selected Worksheets then select Sheet 1 and click OK.
Step 3
9. Create a new Dashboard and in the left pane change the object type to Floating. 10. Drag Sheet 1 to the new dashboard. Click on Sheet 1 and from the drop-down arrow (see below) select Title and remove the check mark. 11. Click on Sheet 1 on the dashboard and from the Layout pane on the left column edit the position as shown below. 12. Select the Dashboard pane and drag Sheet 2 to the dashboard. Click on Sheet 2 and from the drop-down arrow select Title and remove the check mark. 13. Click on Sheet 2 on the dashboard and select the Layout pane on the far left. Enter the Position values noted in step 11. 14. Click on Sheet 2 on the dashboard and from the drop-down arrow, select Floating Order -> Send Backward
Update the filter so that only one category is selected and the Grand Total is not displayed. Select multiple categories in the filter and the Grand Total will display.
Cause
Currently this feature is not built in to Tableau Desktop.
Thank you for providing your feedback on the effectiveness of the article.