Metrics are pre-defined calculations that standardize how your team measures key business values. Create your aggregations once, save them as metrics, and use them consistently across all 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.
Metrics ensure everyone calculates important numbers like revenue, conversion rate, or active users the same way.
Why use metrics
Metrics solve the problem of inconsistent calculations across your organization. Instead of five different people calculating revenue five different ways, you define it once as a metric that everyone can reference.Where you can use metrics
Collections
Save metrics to collections for easy organization and access
Dashboards
Add metrics directly to dashboards for at-a-glance insights
Database browser
View available metrics when browsing your databases
Query builder
Select metrics as aggregation columns in the Summarize block
Using metrics in questions
Metrics integrate seamlessly into the query builder workflow.Common metrics in summarization
When building questions, find your team’s metrics in the summarization section under Common metrics. You can:- Select multiple metrics at once
- Combine metrics with different dimensions
- Use custom expressions to perform calculations on metrics
Metrics as data sources
You can start a question directly from a metric. If the metric includes a time dimension, Metabase automatically groups by that dimension. You can change the grouping to analyze the metric by other dimensions.Creating a metric
Open the metric creation dialog
Use the command palette (Cmd/Ctrl + K) and search for “New metric”, or navigate to Browse > Metrics in the sidebar and click +
Select your starting data
Choose a model, existing metric, table, or saved question as your data source
Define your formula
Create the aggregation that calculates your metric value. This is the required core of your metric
Metric components
The metric editor resembles the regular query builder with key differences:Formula (required)
Formula (required)
The formula is the heart of your metric—the aggregation you’re calculating. You can build metrics on top of other metrics, creating layers of reusable calculations.Examples:
- Count of orders
- Sum of revenue
- Average order value
- (Total revenue - Total costs) / Total revenue
Default time dimension (optional)
Default time dimension (optional)
Set a default time dimension to control how the metric displays in collections and dashboards. Without a time dimension, metrics show as single numbers. With one, they display as line charts.
The default time dimension doesn’t lock the metric. Users can still group by different time dimensions and granularities when using the metric in questions.
Joins and filters (optional)
Joins and filters (optional)
Add joins to bring in data from related tables and filters to focus the metric on specific subsets of data before calculation
Building metrics on metrics
You can create sophisticated calculations by building metrics that reference other metrics:Editing metrics
Time dimension behavior
The default time dimension affects how metrics display, but doesn’t restrict how users can analyze them. Example scenario:- You create a “Revenue” metric
- Set default time dimension to “Created At” by month
- Metric displays as a monthly line chart in collections
- Group by quarter instead of month
- Group by “Updated At” instead of “Created At”
- Remove time grouping entirely
Pinned metrics display
When you pin metrics to a collection, their display depends on the default time dimension:Without time dimension
Displays as a single number card
With time dimension
Displays as a line chart over time
Permissions
Metric permissions work like questions, models, and dashboards through collection permissions.Viewing metrics
A group can view a metric if they have view access to the metric’s collection. This allows them to:- See the metric in the collection
- Select it when building queries
- Use it in questions (question permissions depend on the question’s collection, not the metric’s)
Editing metrics
Editing the metric’s query definition requires curate access to the metric’s collection.Collection permissions interact with data permissions. Users need both collection access to see the metric AND data permissions to query the underlying data source.
Verifying metrics
Available on Pro and Enterprise plans
Best practices
Use clear, business-focused names
Use clear, business-focused names
Name metrics after business concepts (“Monthly Recurring Revenue”) rather than technical details (“sum_of_invoice_amount”)
Add comprehensive descriptions
Add comprehensive descriptions
Explain what the metric measures, how it’s calculated, and any important caveats or filters applied
Build on models when possible
Build on models when possible
Use models as the foundation for metrics to ensure clean, well-structured data
Layer metrics strategically
Layer metrics strategically
Create simple building-block metrics first, then build more complex metrics on top of them
Document calculation changes
Document calculation changes
When editing metrics, clearly document what changed and why to help users understand the impact
Further reading
Models
Learn how to create models as data sources for metrics
Segments
Create reusable filters to focus your metrics on specific data subsets
Collection permissions
Understand how to control access to metrics
Data permissions
Configure access to underlying data sources