---
title: "Measures"
description: "Create saved aggregations on tables so people can use consistent calculations when building queries."
url: "https://www.metabase.com/docs/latest/data-modeling/semantic-layer/measures"
version: "65"
---

> For the complete documentation index, see [llms.txt](https://www.metabase.com/docs/llms.txt).

# Measures

Measures are saved aggregations associated with a table. You can use measures to create an official definition of a calculation—like Net Promoter Score—so everyone in your Metabase uses the same formula instead of writing their own versions.

People will see measures as options in the Summarize block of the [query builder](https://www.metabase.com/docs/latest/questions/query-builder/editor.md).

![Measure in the query builder](https://www.metabase.com/docs/latest/data-modeling/semantic-layer/images/measure.png)

You can define measures on any table. Measures on [published tables](https://www.metabase.com/docs/latest/data-modeling/semantic-layer/published-tables.md) are part of your [semantic layer](https://www.metabase.com/docs/latest/data-modeling/semantic-layer/library.md#semantic-layer).

## Create measures

> If your instance is in read-only [remote sync](https://www.metabase.com/docs/latest/data-modeling/semantic-layer/remote-sync.md) mode, you will not be able to create measures on tables published in the Library while in read-only mode.

Measures are created in [Data Studio](https://www.metabase.com/docs/latest/data-modeling/data-studio.md).

1. Go to **Data Studio** by clicking the **grid icon** in top right of the screen and selecting **Data Studio**.
2. In Data Studio, go to **Connected data** in the left sidebar, and select the table to define a measure on.
3. In the right sidebar for the table, select **Measures**.

   ![Find measures](https://www.metabase.com/docs/latest/data-modeling/semantic-layer/images/find-measures.png)

4. Click **+New measure**. You'll see an abridged version of Metabase's query builder that focuses on aggregation.

5. Add your aggregation formula. For more complex aggregations, check out [custom expressions](https://www.metabase.com/docs/latest/questions/query-builder/expressions.md).

   For example, you can define a measure like `(CountIf([Score] >= 9) - CountIf([Score] <= 6)) / Count() * 100` to calculate Net Promoter Score.

   ![Measure definition](https://www.metabase.com/docs/latest/data-modeling/semantic-layer/images/measure-definition.png)

6. To preview the results of the measure, click on the **three dots** icon next to the measure's name and select **Preview**.
7. Save.

## Use measures in the query builder

Measures allow people to use pre-defined aggregations to summarize their data.

To use a measure in the query builder:

1. Start a new question from the table that the measure is based on.
2. Select the measure in the **Summarize** block.

The measure's saved aggregation will be applied behind the scenes. You can use breakouts with a saved measure.

![Measure in the query builder](https://www.metabase.com/docs/latest/data-modeling/semantic-layer/images/measure.png)

Measures are only available to questions that directly query the measure's table. Measures aren't available for questions that join the measure's table, or that involve nested queries (even if those queries measure's table as a source themselves).

## Delete measures

Deleting a measure won't break questions using it. The questions that use the deleted measure will "revert" to using the measure's (now unnamed) aggregation formula.

1. Go to **Data Studio** by clicking the **grid icon** in top right of the screen and selecting **Data Studio**.
2. In Data Studio, go to **Connected data**, and select the measure's table.
3. In the right sidebar for the table, select **Measures**.
4. Choose the measure you want to delete.
5. On the measure's page, click on the **three dots** icon next to the measure's name and select **Remove measure**.

## Explore measures

You can explore measures along dimensions and compare several measures in the [Metrics Explorer](https://www.metabase.com/docs/latest/questions/metrics-explorer.md).

![Explore a measure](https://www.metabase.com/docs/latest/data-modeling/semantic-layer/images/explore-measure.png)

To see all measures on a table, select the table in [Data Studio > Connected data](https://www.metabase.com/docs/latest/data-modeling/metadata/managing-tables.md) and switch to the **Measures** tab.

## Permissions for measures

To **create, edit, or delete** measures, people need to:

- Be admins or members of the [Data Analysts](https://www.metabase.com/docs/latest/people-and-groups/managing.md#data-analysts) group. This is needed to access Data Studio.
- Have [Create queries](https://www.metabase.com/docs/latest/permissions/data.md#create-queries-permissions) permissions on the measure's table. This is needed to create the measure's query.

To **use** a measure, people need to:

- Have [Create queries](https://www.metabase.com/docs/latest/permissions/data.md#create-queries-permissions) permissions on the measure's table.

## Only measures on published tables are synced to Git

When using [Remote Sync](https://www.metabase.com/docs/latest/data-modeling/semantic-layer/remote-sync.md):

- Measures on tables that are _not_ published to the [Library](https://www.metabase.com/docs/latest/data-modeling/semantic-layer/library.md) are _not_ synced;
- Measures on published tables sync with the Library.


Metrics in the Library sync with it, whether or not their tables are published.

## Limitations

- Measures are only available for use in the query builder. For defining reusable bits of SQL, check out [Snippets](https://www.metabase.com/docs/latest/questions/native-editor/snippets.md).
- Measures are only available on questions that use the measure's table as the primary data source.
- All admins and people in the Data Analyst group can create measures on tables they have permissions to query. There aren't additional controls to restrict who can create measures beyond special groups and data permissions.
- [Only measures on published tables are synced to Git](#only-measures-on-published-tables-are-synced-to-git).

## Further reading

- [Library](https://www.metabase.com/docs/latest/data-modeling/semantic-layer/library.md)
- [Segments](https://www.metabase.com/docs/latest/data-modeling/semantic-layer/segments.md)
- [Metrics](https://www.metabase.com/docs/latest/data-modeling/semantic-layer/metrics.md)
- [SQL snippets](https://www.metabase.com/docs/latest/questions/native-editor/snippets.md)
