Segments
Segments are saved filters on tables. You can use segments to create official definitions of a subset of customers, users, or products that everyone on your team can refer to consistently (for example what constitutes an “active user”).
People will see segments as options in the Filter block of the query builder.

For now, in addition to Data Studio, segments can also be managed through Admin > Table Metadata, see Segments in table metadata.
To see all segments on a table, select the table in Managing tables and switch to the Segments tab.
Create segments
If your instance is in read-only remote sync mode, and you enabled sync of the Library, you will not be able to create segments on tables published in the Library while in read-only mode.
Segments are created in Data Studio.
- Go to Data Studio by clicking the grid icon in top right of the screen and selecting Data Studio.
- In Data Studio, go to Tables in the left sidebar, and select the table to define a segment on.
- In the right sidebar for the table, select Segments.
- Click on + New Segment. You’ll see an abridged version of Metabase’s query builder.
-
Add the filters describing the segment (e.g.
Active = true) and name the segment.
- To preview the records in the segment, click on the three dots icon next to the segment’s name and select Preview.
- Save.
Use segments in the query builder
Segments allow people to use pre-defined filters for their data.
To use a segment in the query builder:
- Start a new question from the table that the segment is based on.
- Select the segment in the Filter block. The segment’s filters will be applied behind the scenes.
Segments will only appear in questions that use the segment’s table as the primary data source. They will not appear in questions joining the segment’s table, or in questions built on other questions or models, even if those questions or models use the segment’s table as a source themselves.
Delete segments
Deleting a segment will not break questions using it. The questions that use the segment will keep using the same filters as before.
- Go to Data Studio by clicking the grid icon in top right of the screen and selecting Data Studio.
- In Data Studio, go to Tables, and select the segment’s table.
- In the right sidebar for the table, switch to Segments tab
- Choose the segment you want to delete.
- On the segment’s page, click on the three dots icon next to the segment’s name and select Remove segment.
Permissions for segments
To create, edit, or delete segments, people need to:
- Be admins or members of the Data Analysts group. This is needed to access Data Studio.
- Have Create queries permissions on the segment’s table. This is needed to create the segment’s query.
To use a segment, people need to:
- Have Create queries permissions on the segment’s table.
Only segments on published tables are synced to Git
When using Remote Sync:
- Segments on tables that are not published to the Library are not synced;
- Segments on published tables are only synced if Library sync is enabled.
If your instance is in read-only Remote Sync mode, and the Library sync is enabled, you won’t be able to create segments on published tables.
Limitations
- Segments are only available for use in the query builder. For defining reusable bits of SQL, check out Snippets.
- Segments are only available on questions that use the segment’s table as the primary data source.
- All admins and people in the Data Analyst group can create segments on tables they have permissions to query. There aren’t additional controls to restrict who can create segments beyond special groups and data permissions.
- Only segments on published tables are synced to Git.
Further reading
Read docs for other versions of Metabase.