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 a metric is created will apply to the metric value, for example, filters for 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.
Metrics with target values
If a metric has a target value assigned to it, you will see a comparison to the target value below the current metric value, both on the metric card and on the metric details. The creator of a metric might include a target value to represent a threshold to stay above, for example, if you need to maintain a 90% on-time delivery rate. Or a target value might represent a cumulative goal you are working toward, for example, a monthly sales target.
Timeline metrics display the target value as a reference line on the timeline. When a timeline metric includes a target value, the comparisons shown for each point on the timeline are to the target value, rather than to the previous point in time.
See connected metrics
Connected metrics are the metrics that were created from a particular view or workbook. To see connected metrics for a view, click the Metrics button in the view toolbar. The metrics displayed are ordered from the newest creation date to the oldest. Users with all site roles can see connected metrics for a view. However, the Create button will appear only if you have a site role of Creator or Explorer (can publish). For more information, see Create a metric.
To see connected metrics for a workbook, click the Connected Metrics tab. You can sort these metrics using the Sort By menu.
Before creating your own metric from a view, it’s a good idea to check the connected metrics. Another user might have already created the metric you want. Instead of creating a duplicate metric, open the existing metric and add it as a favorite.
If you have a site role of Creator or Explorer (can publish), and you have the Create/Refresh Metric capability on the relevant workbook, you can create metrics on Tableau Online or Tableau Server.
Navigate to the view that you want to create a metric from.
On the view toolbar, click the Metrics button.
The metrics pane opens.
If the pane shows connected metrics, select the Create button to enter authoring mode.
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.
There is no need to format the metric, because metrics are automatically optimized for viewing on both mobile and desktop devices.
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 Target value, enter an optional number to compare the metric against. Don’t include commas or symbols in this field. If your target is a percentage, simply type the number without the percent sign, for example, enter 25 instead of 0.25 for a target of 25%.
When you enter a valid target value, the preview updates to show how far above or below the target the current value is. Make sure to note what your target value represents in the metric description.
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 the correct permissions.||
|You can’t access the complete data.||
|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.
- The metric owner doesn’t have the required site role to refresh the metric. A site role of Creator or Explorer (can publish) is required.
- There was a temporary connectivity issue, which will resolve itself.
To identify the cause of the failure, look at the metric details. Make sure that the metric owner has the required site role to refresh the metric. Then inspect the Connected View.
If the connected view is still listed
Open the view to investigate the cause of the failure.
If the view loads, check that the measure and (optional) date dimension that define the metric are still present in the view.
If the view appears to be unchanged, you might no longer have permission to refresh metrics from it. The content owner or a Tableau administrator can change the Create/Refresh Metric permission capability. For more information, see Permissions.
If the measure 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 the view doesn’t load, but instead 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.
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.
Note: If the metric refresh is suspended because you don’t have the required site role for it to refresh, you won’t be able to resume the refresh 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.