Use metrics in a workbook

Metrics are custom aggregate calculations that you can reuse across workbook data elements that share the same data source: a dataset or a connection table. Define metrics at the level of the data source, and apply them to workbooks to ensure consistent metric logic across tables, visualizations, and pivot tables.

This document explains how to use metrics in a workbook to perform standard calculations with ease and efficiency. For more information about metrics in datasets or connection tables, and on how to create, edit, and delete these metrics, see Create and manage metrics.

🚩

Metrics for datasets are generally available.

Metrics for data models are a private beta feature subject to quick, iterative changes. To join a limited test group and enable this feature for your Sigma organization, contact Support or reach out to your Account Executive.

Requirements

To use metrics in workbooks, you must have the following access:

  • Your account type must have the Explore Workbook or Edit Workbook permissions.
  • You must be the workbook owner, or have the Can Explore/Can Edit workbook permissions.

View metric details

  • In a workbook, you can view available metrics of a data element in the Element properties > Metrics tab.
  • Hover over any metric to see its description and formula. 
  • Metrics are specific to an element's data source. All defined metrics appear in the Metrics tab. To create new metrics, see Create a metric.
    Find and review the metric in the Metrics tab
  • Metric suggestions also appear in the formula bar. Simply type the name of the metric, and Sigma auto-completes it for you. To find which metrics are in the system already, type "metrics", and scroll through the available options. Descriptions of the metrics appear as you scroll through the menu.
    Find the metric in the Formula editor

Add metrics to data elements

You can add metrics to many workbook data elements by either dragging metrics onto the correct area in the configuration sidebar, or by using the Add functionality (the plus icon, ).

Metrics in calculations of a grouping level

You can add metrics to calculations of the grouping by dragging the metric:

  1. Under the Groupings header, ensure that you have at least one grouping.
  2. Click on the metric, and drag it into the Calculations area.
Add a metric to a grouping calculation by dragging

Alternatively, add the metric in the element itself:

  1. Under the Groupings header, ensure that you have at least one grouping.
  2. In the Calculations area, click the plus icon, .
  3. In the drop-down menu, select the metric. The menu groups the metrics, so you can find them easier.
Add a metric to a grouping calculation through new

Metrics in the summary bar

To add a metric to the summary of a table, follow these steps:

  1. Click (plus/new icon).
  2. In the menu, under the Metrics header, select the metric to aggregate the grouping.
Add a metric to a to a summary calculation in a table

Metrics in visualizations

In many visualization types, you can place a metric on the value axis; typically, this is the Y-axis. In other visualizations, the metrics can specify the color scale, main KPI parameters, tooltips, and others. Here, we demonstrate how to add metrics to the value axis and tooltips.

Value

To add a metric to the value axis of the visualization, you can drag the metric from the Metrics tab into the axis specification area.

Alternatively, follow these steps:

  1. Click (plus/new icon) next to the name of the axis. Typically, this is the Y-axis.
  2. In the menu, under the Metrics header, select the metric.
Add a metric to the value axis of a visualizations

Tooltip

To add a metric to the visualization's tooltip, follow these steps:

  1. Under the Marks options, select the Tooltip tab.
  2. Click Metrics.
  3. Choose the metric from the list, and drag it to the Select column area.

Alternatively, click the plus icon, , in the Select column area, and choose the metric from the drop-down menu.

Add a metric to a tooltip

When you hover over the visualization element, the tooltip appears. Notice that it contains the metric you added.

A metric appears in the tooltip

Metrics in pivot tables

In pivot tables, you can add metrics to the Values area.

Add the metric by dragging it from the Metrics table to the Values area: 

  1. Select the Metrics tab.
  2. Find and select the metric.
  3. Drag the metrics into the Values area of the pivot table specification.

Alternatively, click the plus icon, , in the Values area, and select the metric from the drop-down menu.

Add metrics to the pivot table

Notice that the new metric appears in the pivot table.

Metrics added to the pivot table

Metrics in the formula bar

You can use metrics as part of a calculated formula for a new column.

Metrics in calculated formulas, specified in formula bar

Related resources