Metrics are custom aggregate calculations that you can reuse across workbook data elements that share a data source. Metrics don’t exist in an element; instead, they inform the column calculation. You can create metrics in both tables and datasets.
Define metrics at the level of the data source to promote consistent metric logic across elements, and to help users perform standard calculations with ease and efficiency. Creating a metric establishes metric logic that improves governance.
This document explains how to create and manage metrics for improved metrics governance. For information about applying metrics to workbook data elements, see Use metrics in a workbook.
To create and manage metrics, you must have the following access:
You must have an account type with the Edit Dataset permission enabled.
You must be the dataset owner, or have Can Edit dataset permission.
You must have the Admin account type.
Metrics differ from calculated columns in a dataset. Calculated columns use static calculations to produce static unaggregated values for individual (ungrouped) table rows, or for aggregated values at specific static grouping levels.
In contrast, the metric is a dynamic and reusable calculation that provides aggregated values for any grouping level.
When you add a calculated column to a data element, you define its calculation logic. Metric logic definition resides in the data source; you can reuse it in any element that references the dataset or the connection table.
If standard calculation logic changes, you must individually edit calculated columns in all applicable elements. If metric logic changes, updating the metric formula in the data source results in an automatic recalculation of metric result in all client elements of the metric.
When defining a new metric, you can use an existing metric in your formula. This is a very powerful practice to build reusable calculation components. Whenever you change the metric definition, updating its formula automatically updates its output values and the output values of every metric that includes the original metric in its calculation.
You can only define metrics in a data source. If the same metric logic applies across your organization, or across multiple data sources, you must define the metric again, in each applicable dataset and connection table.
If you create a new dataset from a data source that has metrics, the new dataset doesn’t inherit the existing metrics. You must, instead, create new metrics if the new dataset requires metric logic.
Similarly, the lineage of metrics persists for two child levels downstream.
Metric formulas don't support window functions, which use values from multiple rows to return a value for each row.
Follow these steps to create a metric:
Open a dataset or connection table.
Click Edit in the header.
Select the Metrics tab.
Click Create Metric to open the metric builder.
Create the metric with the following field values:
In the Name field, enter the name of the metric.
In the Description field, enter details about the metric.
This information displays when users apply metrics to a workbook element.
In the Formula field, define the metric logic.
You can use Sigma’s functions, and reference any column in the open dataset or connection table.
You can also use an existing metric of the dataset; this is a very powerful practice to build reusable calculation components in your dataset.
Use the quick formatting tools and preview to customize the metric output.
For example, you can specify the formula result as a currency or a percentage, set the number of decimal places, or select options from the full format menu by clicking the number format menu, .
Metrics define aggregate calculations. If the metric builder preview returns a “null” value, your formula may be missing an aggregate function, such as
Count(), and so on.Total
In the header, click Publish to save the metric.
When you edit a metric, Sigma reflects your changes in workbook elements that link to the specific dataset or connection table. All workbook references to the metric include name and description changes, and Sigma recalculates metric results based on formula updates.
To edit a metric, follow these steps:
- Open the dataset or connection table that contains the metric that you plan to edit.
- Click Edit.
- Select the Metrics tab.
- Locate the metric in the list, and click its name to open it in the metric builder.
- Edit the metric name, description, formula, and formatting as needed, then click Publish to update the metric.
When you delete a metric, its calculation becomes invalid in workbook elements. Tables display error messages in columns that previously produced metric output. Visualizations and pivot tables display an error message instead of the element.
Open the dataset or connection table that contains the metric you plan to delete.
Select the Metrics tab.
In the list of metrics, find the metric that you plan to delete.
Click the () action icon of the metric, and select Delete.
Alternatively, select the metric to open the metrics builder, locate the metric in the side panel, and click the Delete metric icon next to the name of the metric.
Updated 3 months ago