Show or hide measures using scripting functions

Use the SHOWMEASURES function to show or hide all measures in a planning sheet. Pass TRUE to show the measures or FALSE to hide them.

Syntax

Use the following syntax to show or hide measures.

SHOWMEASURES(TRUE)

To hide all measures, use the following formula:

SHOWMEASURES(FALSE)

Example

The following example uses a toggle parameter to show or hide all measures in a planning sheet. When the toggle is on, the SHOWMEASURES function displays the measures. When the toggle is off, the function hides the measures.

Configure a toggle parameter

  1. In the planning sheet, create an Action parameter named Show Measures.

  2. Set the Interface Type to Toggle and select Enable Script.

  3. Under On Actions, add a planning action and enter the following formula in Formula Script:

    SHOWMEASURES(TRUE)
    

    Screenshot of the On State Configuration dialog with SHOWMEASURES(TRUE) entered in Formula Script.

  4. Under Off Actions, add a planning action and enter the following formula in Formula Script:

    SHOWMEASURES(FALSE)
    

    Screenshot of the Off State Configuration dialog with SHOWMEASURES(FALSE) entered in Formula Script.

  5. Set Default State to Show Measures.

  6. Save the parameter.

Test the toggle

Open the Parameter pane and switch the toggle between Show Measures and Hide Measures.

  • When the toggle is on, the planning sheet displays all measures.

    Screenshot of the planning sheet displaying all measures when the Show Measures toggle is on.

  • When the toggle is off, the planning sheet hides all measures while retaining the row hierarchy.

    Screenshot of the planning sheet with all measures hidden and the row hierarchy still visible when the Show Measures toggle is off.