Create and Troubleshoot Metrics
Metrics help you track changes to your data. You can quickly monitor key numbers, because metrics update automatically and display their current value on the grid and list view for your content. This means that you don’t need to open a metric to see your data.
If you have multiple dashboards you frequently check, create metrics for the numbers you want to monitor, then track them in one place by adding them to your favorites or creating them in the same project.
How metrics are defined
A metric's value is defined by an aggregate measure, such as sum of sales, and an optional date dimension, such as order date. For information about dimensions and measures, see Dimensions and Measures, Blue and Green. Any filters applied to the measure before the metric was created will apply to the metric value, for example, filters for segment or region.
Timeline metrics and single-number metrics
A metric that has a date dimension as part of its definition will have a timeline. Because metrics are defined based on the mark you select when you create a metric, you include a timeline by selecting a mark on a chart with a date axis or header.
When you open a metric, the timeline shows the value of the measure based on the granularity of the date dimension, for example, daily sales or monthly users. Move your mouse along the timeline to see historical values.
If the mark you select doesn't have a date dimension associated with it, your metric will be a single-number metric. Single-number metrics still refresh, and their values update when the data changes, but they don't show previous values on a timeline.
Create a metric
If you have a site role of Creator or Explorer (can publish), you can create metrics on Tableau Online or Tableau Server. Metrics are formatted automatically and optimized for viewing on both mobile and desktop devices.
Navigate to the view that you want to create a metric from.
On the view toolbar, click the Metrics button.
The metrics pane opens.
Select a mark. If you encounter an error, see When you can’t create a metric.
The measure, and optional date dimension, associated with this mark will define your metric. Any filters you apply to this mark will be applied to your metric.
The metrics pane shows a preview of your metric. The value in the preview is the most recent value for the metric, which may differ from the value of the mark you selected in the case of metrics with a date dimension.
The Name field is pre-populated based on your selection. You can give the metric a different name. A metric must have a unique name within the project it belongs to.
Under Description, enter an optional message to help others understand your metric. For example, describe filters applied to the metric or indicate the data source used by the metric.
Under Definition > Measure, select the measure to use for your definition from the drop-down. This option appears only if the mark you selected has more than one measure associated with it.
Click the Create button.
A message appears with a link to the metric in the project you added it to.
Though metrics are created from a view, they exist independent of that view. This means you manage metrics similar to how you manage workbooks. For example, you can set permissions for a metric or move it to another project. For information about managing content on your Tableau site, see Manage Web Items.
Create a metric with the same name in the same project as the metric you want to overwrite.
The Overwrite Metric dialog appears.
Click the Overwrite button.
When you overwrite a metric, the metric continues to appear for those who have added it to their favorites, and any changes made to permissions for the previous metric will apply to the new metric.
If you select a mark on a chart that doesn’t support metrics, you will get an error message explaining why you can’t create a metric. The table below summarizes these scenarios.
|You don’t have access to the full data for the chart.|
|The password for the workbook’s data source is not embedded or is no longer valid. For more information, see Set Credentials for Accessing Your Published Data.||
|The data isn’t at the correct level of granularity.|
|The date dimension is not supported.||
How metrics refresh
When a metric refreshes, it checks the connected view (the view the metric was created from) for new data. A refresh doesn’t necessarily update the value of a metric, because there may be no changes to the data.
Metrics refresh at a frequency either based on an extract’s refresh schedule or, for live data, every 60 minutes. The time of the last refresh is displayed on the metric.
If a metric isn’t able to access the connected view or its underlying data, the refresh will fail. If the refresh for your metric fails, you’ll receive an email notification, which notes the time of the failure and the affected metric.
Metric refreshes may fail for one of the following reasons.
- The connected view was deleted or modified.
- Permissions changed for the connected view.
- The password for the data source is no longer embedded or is no longer valid.
- There was a temporary connectivity issue, which will resolve itself.
To identify the cause of the failure, inspect the Connected View under Metric Details.
If the connected view is still listed
Open the view to investigate the cause of the failure.
|The workbook prompts for a password or displays an error when connecting to the data source.||The password for the data source is not embedded or is no longer valid.||The content owner or a Tableau administrator can edit the data source connection to embed the password. For more information, see Edit Connections.|
|You can't view the full data, following the instructions on View Underlying Data.||You no longer have permission to access to the full data.||The content owner or a Tableau administrator can change the permissions for the view. For more information, see Permissions.|
|The measure or date dimension that defines the metric is no longer present.||The view has been modified so the metric can't connect to the data needed to refresh.||The content owner or a Tableau administrator can check the revision history and restore previous versions. For more information, see View Revision History|
If there is no connected view listed
The view was deleted or you no longer have permission to access the view. Contact your Tableau administrator for assistance.
Resume suspended refreshes
If a refresh fails enough times, the refresh is suspended. You’ll receive an email notification if the refresh for your metric is suspended.
When a metric refresh is suspended, Tableau no longer attempts to get new data for the metric. Metrics with suspended refreshes continue to present historical data.
If the cause of the failure is fixed, you can resume the refresh.
- Open the affected metric.
- On the warning message, click Resume refresh.
Tableau attempts to perform the refresh. If this attempt succeeds, you’ll receive a notification, and the refresh will resume on schedule. If the attempt doesn’t succeed, your refresh remains suspended.
Try overwriting the metric if the connected view is still available. For more information, see Overwrite a metric. Otherwise, you can keep the metric to reference past data or delete the metric.
Metrics Appear in Tableau Catalog
Starting in 2019.3, Tableau Catalog is available in the Data Management Add-on to Tableau Online and Tableau Server. When the Tableau Catalog is enabled in your environment, you can see metrics in the Catalog lineage tool, and metrics affected by data quality warnings display those warnings. For more information about Tableau Catalog, see "About Tableau Catalog" in the Tableau Server(Link opens in a new window) or Tableau Online(Link opens in a new window) Help.
When you have metrics defined for the numbers you want to monitor, it's important to know if the data that the metrics rely on are impacted in any way. You can use Catalog in a couple of ways to know this. First, data quality warnings set on the data your metric is based on show on the metric. These warnings appear when you open a metric in Tableau Mobile, and in Tableau Server and Tableau Online when you hover over a metric in grid view and on the metric details page, as shown below:
You can also use the lineage tool in Tableau Catalog to see the upstream sources that your metric relies on. When doing an impact analysis, you can see which metrics are affected if a certain column or a table is changed or deprecated, or if certain workbooks are removed. Including metrics in the lineage means that Catalog gives a full picture of the impact changes can have on the assets in your environment.