KNOWLEDGE BASE

Display Grand Totals Column For Each Nested Dimension Member


Published: 18 Oct 2017
Last Modified Date: 18 Oct 2017

Question

How to display one grand totals column for each dimension member of a nested dimension on the Columns shelf

Environment

Tableau Desktop

Answer

Create a calculated field isolating the measure values for each dimension member. Use the calculated fields in place of the original dimension. The attached workbook demonstrates the following directions. 

Step 1: Create 3 calculated fields

  1. Select Analysis > Create calculated field
  2. Name the calculated field "First Class Sales" and enter the following formula and click OK
    IF [Ship Mode] = "First Class"
    THEN [Sales]
    END
  3. Select Analysis > Create calculated field
  4. Name the calculated field "Second Class Sales" and enter the following formula and click OK
    IF [Ship Mode] = "Second Class"
    THEN [Pivot field values]
    END
    
  5. Select Analysis > Create calculated field
  6. Name the calculated field "Standard Class Values" and enter the following formula and click OK
    IF [Ship Mode] = "Standard Class"
    THEN [Pivot field values]
    END
    

 Step 2: Build the view

  1. Drag [City] to the Columns shelf.
  2. Drag [Sub-Category] to the Rows shelf.
  3. Double-click [First Class Sales], [Second Class Sales] and [Standard Class Sales].
  4. Move [Measure Names] from the Rows shelf to the Columns shelf.
  5. Navigate to Analysis > Totals > Show row grand totals.
Did this article resolve the issue?