KNOWLEDGE BASE

Adding a KPI to a Highlight Table


Published: 24 Jul 2019
Last Modified Date: 30 Jul 2019

Question

How to add a KPI over a highlight table

Environment

Tableau Desktop

Answer

Create a dual axis view using two dummy axes, where one axis is the highlight table (using the Square mark type) and the second axis is the KPI (using the Shape mark type). These directions start from the "Original View" in the workbook that can be downloaded from the right-hand pane of this article.

Step 1: Create the calculations

  1. Select Analysis > Create Calculated Field
  2. In the Calculated Field dialog box that opens, do the following, and then click OK:
    1. Name the calculated field. In this example, the calculated field is named "Container"
    2. In the formula field, enter: 0
  3. Create a calculated field with a name like "Blank" with the following calculation: ""

Step 2: Create the view

  1. Drag [Container] to the Columns shelf.
    • This creates a continuous numeric axis where all square marks are plotted at zero, because that is the only value in [Container]
  2. Drag a second copy of [Container] to the Columns shelf.
  3. Click the first instance of [Container] on the Columns shelf to open its corresponding Marks card, and do the following:
    1. Remove [Sales] from Label.
    2. Click Size and drag the slider all of the way to the right.
  4. Drag [Blank] to the Rows shelf after [Segment].
  5. Right-click [Blank] on the Rows shelf and uncheck Show header.
  6. Click the second instance of [Container] on the Columns shelf to open its corresponding Marks card, and do the following:
    1. Change the mark type to Shape in the dropdown menu.
    2. Remove [Profit] from Color.
    3. Drag [Shape KPI] onto Shape.
  7. Right-click the second instance of [Container] on the Columns shelf and check Dual Axis.

Step 3: Format the view

  1. Right-click the first instance of "Container" in the view and select Edit Axis
  2. In the Edit Axis dialog, do the following and close the dialog:
    1. Delete "Container" from Title.
    2. Navigate to the Tick Marks tab.
    3. For Major Tick Marks, select None.
  3. Right-click the second instance of "Container" in the view and select Edit Axis.
  4. In the Edit Axis dialog, do the following and close the dialog:
    1. Delete "Container" from Title.
    2. For Range, select Fixed.
    3. Type in range start and end values to move the shape to the desired position.
    4. Navigate to the Tick Marks tab.
    5. For Major Tick Marks, select None.
  5. Navigate to Format > Lines.
  6. In the left-hand Format pane, navigate to the Columns tab, and set Grid Lines and Zero Lines to None.
Did this article resolve the issue?