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 favourites or creating them in the same project.

Grid of profit metrics

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.

Timeline of weekly metric 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.

A single-number metric and timeline metric

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 towards, for example, a monthly sales target.

Metrics cards with target values

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.

Metrics timeline with a target value

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.

View toolbar and metrics connected to the view

To see connected metrics for a workbook, click the Connected Metrics tab. You can sort these metrics using the Sort By menu.

Workbook page and metrics connected to the workbook

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 favourite.

Create a metric

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.

  1. Navigate to the view that you want to create a metric from.

  2. On the view toolbar, click the Metrics button.

    View toolbar with metrics button highlighted

    The metrics pane opens.

  3. If the pane shows connected metrics, select the Create button to enter authoring mode.

  4. 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.

    Selecting a mark on a multi-chart view

    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.

    Preview of metric value

    There is no need to format the metric, because metrics are automatically optimised for viewing on both mobile and desktop devices.

  5. 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.

  6. 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.

  7. 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 percentage 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.

  8. 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.

  9. Selecting measure from dropdown

  10. Under Project, click Change Location to choose a different project for the metric. By default, your metric will be added to the same project that the view belongs to.

  11. Click the Create button.

    A message appears with a link to the metric in the project you added it to.

    Success message

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.

Overwrite a metric

  1. Create a metric with the same name in the same project as the metric you want to overwrite.

    The Overwrite Metric dialog appears.

  2. Click the Overwrite button.

When you overwrite a metric, the metric continues to appear for those who have added it to their favourites, and any changes made to permissions for the previous metric will apply to the new metric.

When you can’t create a 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 summarises these scenarios.

Reason Scenarios
You don’t have the correct permissions.
  • The workbook owner or an administrator has denied the Create/Refresh Metric capability. For more information, see 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 workbook prompts for a password.
  • Credentials are passed using single sign-on (SSO).
The data isn’t at the correct level of granularity.
  • The data in the chart isn't aggregated. Metrics use aggregations, such as sum or average. For more information, see Data Aggregation in Tableau.
  • There are multiple values per cell of data – a result of data blending. For more information, see Troubleshoot Data Blending.
The date dimension is not supported.
  • The chart includes both date parts and date values. For more information, see Change Date Levels.
  • The date dimension uses the ISO 8601 calendar rather than the standard Gregorian calendar. For more information, see ISO-8601 Week-Based Calendar.
  • The date dimension is aggregated at the custom level of Month / Year or Month / Day / Year. For more information, see Custom Dates.

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.

Fix failing refreshes

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.

Metric connected view highlighted under Metric Details

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.

  1. Open the affected metric.
  2. 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 Catalogue

Starting in 2019.3, Tableau Catalogue is available in the Data Management Add-on to Tableau Online and Tableau Server. When the Tableau Catalogue is enabled in your environment, you can see metrics in the Catalogue lineage tool, and metrics affected by data quality warnings display those warnings. For more information about Tableau Catalogue, see "About Tableau Catalogue" 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 Catalogue 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:

Metric with data quality warning

For more information, see "Set a Data Quality Warning" in the Tableau Server(Link opens in a new window) or Tableau Online(Link opens in a new window) Help.

You can also use the lineage tool in Tableau Catalogue 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 Catalogue gives a full picture of the impact changes can have on the assets in your environment.

Impact on lineage when filtered by a field

For more information, see "Use Lineage for Impact Analysis" in the Tableau Server(Link opens in a new window) or Tableau Online(Link opens in a new window) Help.

 

Thanks for your feedback!