Models are a fundamental building block in Metabase. They curate data from tables to anticipate the kinds of questions people will ask. Think of them as derived tables or special saved questions designed to be reused as starting points for new questions.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/metabase/metabase/llms.txt
Use this file to discover all available pages before exploring further.
Models can be based on SQL or query builder questions, allowing you to include custom calculated columns and complex transformations.
What models can do
Models provide powerful capabilities for organizing and enhancing your data:- Enhanced metadata: Update column descriptions and customize metadata to create intuitive starting points for exploration
- Improved discoverability: Show up higher in search results and get highlighted when users start new questions
- Organized in collections: Keep models separate from complex database schemas by storing them in collections
- Searchable records: Surface individual records in search results by indexing specific columns
- Performance optimization: Can be persisted for faster loading times
Use cases for models
Business concepts
Create intuitive representations of business concepts like “Customer” by pulling together data from multiple tables and adding calculated columns like lifetime value (LTV)
Enable exploration
Let people explore SQL query results with the query builder by properly setting column types
Summary tables
Create summary tables that aggregate and combine data from multiple sources
Clean datasets
Simplify tables by filtering out unnecessary columns and rows
Creating a model
Before creating a new model, search for existing ones that might meet your needs.- From scratch
- From a saved question
Open the model creation dialog
Navigate to the Models tab in the sidebar (under Data section) and click the + button, or use the command palette (Cmd/Ctrl + K) and type “model”
Choose your query method
Select either the query builder or SQL. The query builder allows Metabase to automatically fill out some metadata; SQL requires manual metadata configuration
Model metadata
Metadata is the key to making models powerful. When you write SQL queries, Metabase can display results but doesn’t automatically understand the data types. Adding metadata enables query builder exploration and improves filtering and visualization.If you only set one type of metadata, set the Column type to enable Metabase’s query builder features.
Display name
Display name
The user-facing name for the column that appears throughout Metabase
Description
Description
Helpful context about what the column contains and how it should be used
Database column mapping
Database column mapping
For SQL-based models, map columns to existing database columns to inherit their types
Column type
Column type
Set the semantic type (e.g., Email, URL, Currency). Required for SQL models to enable query builder exploration
Visibility settings
Visibility settings
Choose whether columns appear in table views, detail views only, or both
Display format
Display format
Configure how values display (as text or clickable links)
Search indexing
Search indexing
Enable individual records to appear in search results by indexing string fields with integer primary keys. Limited to 25,000 unique values per field
Model list view
List view helps you explore records one by one instead of sorting through large tables.Customizing list layout
Each list item includes:- Entity icon: Displays an image if the record has an image link
- Left column: Shows the title or primary identifier
- Right column: Displays up to 5 additional columns
Referencing models in SQL
You can reference models in SQL queries just like tables:Editing models
Click the down arrow next to a model’s name and select Edit query definition to modify the underlying query.Checking for breaking changes
Available on Pro and Enterprise plans
Model details and history
Click the info button to view:- Overview: Description, creator, last editor, field list, and Entity ID
- History: Change log with previous 15 versions (you can revert to earlier versions)
- Relationships: Questions using the model and linked tables
- Actions: Actions created based on the model
- Insights: Usage analytics (Pro/Enterprise only)
Model persistence
Models can be persisted to improve query performance. Persisted models cache results in your database, allowing faster loading times for frequently accessed data. For detailed information, see the Model persistence documentation.Verification and permissions
Admins and users with appropriate permissions can verify models to indicate they’re trusted and ready for use. Verified models display a checkmark badge in the interface. For more information, see Content verification.Further reading
Model persistence
Learn how to persist models for faster query performance
Metrics
Create reusable calculations based on models
Troubleshooting models
Common issues and solutions for working with models
Models tutorial
Step-by-step guide to using models effectively