Skip to main content
All CollectionsBest Practice
Alternative Measure in Charts
Alternative Measure in Charts
Astrato Support avatar
Written by Astrato Support
Updated yesterday

Introduction

Switching the active measure (KPI) in one or more visualizations allows users to analyze data from different perspectives using the same dashboard and to drill down on KPIs.
The document will describe how to build a solution that allows end-users to change the active measure in visualizations.
​



DVE- create the measures

In the Dataview, we'll create a few measures to support the use case

  • Create the two measures to be displayed in the chart.

  • Create a measure that only includes a parameter.
    ​

  • Create a Conditional measure and use the three measures from the previous steps.
    The measure should look like this:
    ​

Workbook

  • Define Variables

    In the workbook, create two new variables.

    • A numeric variable with the same name as the parameter in the measure created in the previous step.
      Set the default value to one.


      ​

    • A string variable gives it a name and sets the default value to the name of the default measure.
      ​


      ​

  • Define Actions

    Open the Action editor and create a new action block.

    The Action block will track changes in the "Selected Measure" variable
    And change the value of the numeric variable accordingly.

  • Build Visualizations

    Create a visualization using the conditional measure created in the DVE section.
    In the measure settings:

    • Activate the custom label and use the "Selected Measure" variable

    • Make sure the numeric variable is tied to the measure.
      ​


      ​

  • Build a Control to Change the Active Measure

    • Add a drop-down atomic input form to the screen.
      ​


      ​

    • Use the "Selected Measure" variable and define the option for the drop-down list as displayed in the image below.
      ​


      ​

  • Test

    Preview the app and change the value in the drop-down list to test the solution.
    ​


    ​

Did this answer your question?