KNOWLEDGE BASE

How to Display Cumulative Values in Subtotals


Published: 02 Sep 2022
Last Modified Date: 05 Sep 2022

Question

How to display cumulative values in subtotals.

User-added image

Environment

  • Tableau Desktop

Answer

Below is an example of displaying the cumulative sales values for each category in a subtotal.

1. Create a calculated field and name it Cumulative Sales.
IF SIZE() > 1 THEN RUNNING_SUM(SUM([Sales]))
ELSE SUM([Sales])
END
2. Add Category to Rows.
3. Add Sub-Category to Rows.
4. Add Measure Names to Filters and only select Sales and Cumulative Sales.
5. Add Measure Names to Columns.
6. Add Measure Values to Text.
7. Right-click Cumulative Sales in Measure Values Shelf and select Edit Table Calculation. Set it as follows:
User-added image
 
Did this article resolve the issue?