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 details about metrics in data models, datasets, and database tables, see About metrics. To create or manage 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. Beta features are subject to the Beta features disclaimer.
Because metrics are aggregate calculations, add them to aggregated data:
You can also use metrics in formulas.
Requirements
To use metrics in workbooks, you must have the following access:
- You must be assigned an account type with the Full explore or Create, edit, and publish workbooks permissions enabled.
- You must be the workbook owner, or have Can Explore or 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 title, 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 and manage metrics.
- Metric suggestions also appear in the formula bar. Start typing the name of the metric to see auto-complete suggestions. To find which metrics are available, type "metrics", and scroll through the available options. Descriptions of the metrics appear as you scroll through the menu.
Add a metric to a grouped table
To calculate a metric as an aggregate within a grouping:
- Select a table with at least one column grouping.
- For Calculations, select + (Add column...) and select the metric.
Add a metric to the summary bar
To calculate a metric as an aggregate for the entire table:
- In the summary bar, click ^ to expand the summary bar, then select + (Add summary...).
- Choose the metric name from the list of available metrics and columns.
Do not add another aggregation on the metric, because the metric is already aggregated.
Add a metric to a visualization
You can use a metric like any aggregate calculation in a visualization. Add a metric to a chart as the value axis or add the metric to a tooltip. Depending on the chart, you can also use a metric to specify the color scale, and more.
Chart a metric on the value axis
To add a metric to the value axis, usually the y-axis, of a visualization:
- Next to the name of the axis, click + (Add column...).
- In the menu that appears, under the Metrics header, select the metric.
Add a metric to a tooltip
To add a metric to a visualization's tooltip, follow these steps:
- Under the Marks options, select the Tooltip tab.
- Click Metrics.
- 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 as a pivot table value
In pivot tables, you can add metrics to the Values area.
- In the Values section of the pivot table, select + (Add column...).
- In the menu that appears, under the Metrics header, select the metric.
Use a metric in a calculated column
You can also use a metric in a formula for a calculated column, the same way you might use a data source column. Use the syntax [Metrics/<Metric Name>]
to reference a metric. For example, for a metric called Unique Users, include it in a formula:
If([Metrics/Unique Users] > 500, "Popular", "Unpopular")
Updated 10 days ago