Loading

Use Dynamic Zone Visibility to Show or Hide Sheets Based on a Filter

Veröffentlichungsdatum: Nov 19, 2025
Voraussetzung(en)
Tableau Desktop
Aufgabe

Control the dynamic display of sheets on a dashboard so that sheets with no data are hidden, and sheets with data are visible, based on a filter selection.

Schritte

The Dynamic Zone Visibility feature uses a parameter to control the visibility of objects placed on a dashboard. This procedure details how to dynamically show and hide sheets in response to filter selections.

 

  1. Create Base Worksheets
    In this step, create three sheets, Left, Center, and Right, containing sales data for specific years.
    1. Create the Left Sheet
      1. Rename the worksheet to "Left".
      2. Create a calculated field: [Filter: OrderYear] with the formula YEAR([Order Date]).
      3. Add [Order Date] to the Rows shelf and change the format from "Custom" to "Month/Year".
      4. Add [Sales] to the Text mark on the Marks card.
      5. Add [Order Date] to the Filter shelf, select Years > 2022, 2023, then right-click the pill on the Filter shelf and add it as Context (the pill turns grey).
      6. Add [Filter: OrderYear] to the Filter shelf, select "Use all", then right-click the pill on the Filter shelf and add it as Context (the pill turns grey).
    2. Create the Center Sheet
      1. Duplicate the "Left" sheet and rename it to "Center".
      2. Edit the [YEAR(Order Date)] filter on the Filter shelf to select only 2024.
    3. Create the Right Sheet
      1. Duplicate the "Center" sheet and rename it to "Right".
      2. Edit the [YEAR(Order Date)] filter on the Filter shelf to select only 2025.

  2. Create the Control Worksheet for Dynamic Zone Visibility
    This step creates the control sheet "Show/Hide" and the necessary parameters and calculated fields for the dashboard action trigger.
    1. Add a new worksheet and rename it to "Show/Hide".
    2. Create the following three Boolean parameters and set the Current Value to True for all of them.
      1. [PRM_Left]
      2. [PRM_Center]
      3. [PRM_Right]
    3. Create the following three calculated fields.
      Adjust these formulas to return True if at least one piece of data is displayed when the filter is used.
      1. [DZV_Left_DataCheck] : {FIXED : MAX(IF YEAR([Order Date]) = 2022 OR YEAR([Order Date]) = 2023 THEN 1 ELSE 0 END)} = 1
      2. [DZV_Center_DataCheck] : {FIXED : MAX(IF YEAR([Order Date]) = 2024 THEN 1 ELSE 0 END)} = 1
      3. [DZV_Right_DataCheck] : {FIXED : MAX(IF YEAR([Order Date]) = 2025 THEN 1 ELSE 0 END)} = 1
    4. Double-click the Rows shelf and type "Show/Hide", and add it as a Text mark on the Marks card.
    5. Add the three calculated fields ([DZV_Left_DataCheck], [DZV_Center_DataCheck], [DZV_Right_DataCheck]) to Detail on the Marks card.
    6. (Option) Adjust the text formatting.

  3. Configure the Dashboard
    1. Add a dashboard sheet.
    2. Drag a Horizontal Container onto the dashboard sheet.
    3. Arrange the Left, Center, and Right sheets inside the Horizontal Container in three columns.
    4. Add the [Filter: OrderYear] as a filter.
    5. Add the "Show/Hide" sheet below the filter.
    6. From the [Filter: OrderYear] filter's menu, select Apply to Worksheets > Selected Worksheets and choose the Center, Right, and Show/Hide sheets.
    7. In the menu bar, go to Dashboard > Actions and create the following three "Change Parameter" actions:
      1. Action 1: Source Sheets: [Sample Dashboard] > "Show/Hide" | Target: [Parameter: [PRM_Left] | Source Field: [DZV_Left_DataCheck]
      2. Action 2: Source Sheets: [Sample Dashboard] > "Show/Hide" | Target: Parameter: [PRM_Center] | Source Field: [DZV_Center_DataCheck]
      3. Action 3: Source Sheets: [Sample Dashboard] > "Show/Hide" | Target: Parameter: [PRM_Right] | Source Field: [DZV_Right_DataCheck]
        Actions_Sample 

    8. Select the Left sheet within the Horizontal Container. In the Layout pane, turn ON "Control visibility using value" and select [PRM_Left].
    9. Repeat the step for the Center and Right sheets, selecting [PRM_Center] and [PRM_Right] respectively.
      DZV_Setting 
Zusätzliche Ressourcen

Use Dynamic Zone Visibility

Nummer des Knowledge-Artikels

005228886

Anhänge

DZV_Sample.twbx

1375 KB

 
Laden
Salesforce Help | Article