Show Table of Contents
Any data view in Tableau can include subtotals. For example, you may have a view containing the total sales for two product types broken down by specific products. In addition to seeing the sales for each product you may want to see the total sales for each product type.
You can add subtotals for all fields or for selected fields. To add subtotals for all fields, choose Totals > Add All Subtotals from the Analysis menu. You then have the option of turning subtotals off for one or more individual fields. You do this by toggling subtotals off, as per the inststructions below for turning subtotals off for individual fields.
To calculate subtotals for an individual field, right-click (Control-click on a Mac) the field in the view and choose Subtotals from the context menu.
A check mark then appears next to Subtotals on the context menu.
You can quickly set the aggregation for subtotals by clicking the column or row header and choosing an aggregation from the drop-down list on the tooltip:
When you turn on subtotals for a specific field, the totals will change based on where that field is in the view. Consider the following example. The view below shows the sales for different product types sold across four different markets. Each product type is broken down by specific products. In addition, subtotals are turned on so that the view shows the total sales for each product type.
Now let’s move the Product Type field from the Rows shelf to the Columns shelf. The view still shows the sales for four different product types; but now, the product types are broken down by market. Because subtotals were turned on for the Product Type, the subtotals are the sum of the sales completed in each market.
Note: By default subtotals are computed on the server if you are connected to an SSAS data source and locally if you are connected to an Essbase data source using the aggregation specified in the cube. That means if you are analyzing the average sales for each product, calculating the subtotals for each product type would result in the average sales of all products within that product type. This is not the case if you perform the computation locally instead of remotely.