Get Started with Metrics Views
A metrics view is a 'centralized framework' used to define and organize key measures and dimensions for your organization. Having a centralized layer allows an organization to easily manage and reuse calculations across various reports, dashboards, and data tools. Each metrics view is powered by a single model or table.
Rill metrics views are analogous to the semantic layer and metrics layer concepts found in other business intelligence and analytics tools. It provides a consistent, reusable abstraction over your underlying data, enabling standardized definitions of business metrics that can be shared across different dashboards and reports.

In Rill, your metrics view is defined by metric definitions. Metric definitions are composed of:
- model/table - A data model or underlying table created with the concept of One Big Table that will power the metrics view.
- timeseries - A column from your model that will underlie x-axis data in Rill's Explore dashboards and Canvas dashboards. Time can be truncated into different time periods.
- dimensions - Categorical columns from your data model whose values are shown in leaderboards in explore dashboard and allow you to look at segments or attributes of your data (and filter/slice accordingly) as well as selectable axis in Canvas dashboard components.
- measures - Numerical aggregates of columns from your data model shown on the y-axis of the explore charts and canvas components and the "big number" summaries.
Creating a Metrics view
Once your model or underlying table is ready to visualize, you'll need to create a metrics view to define your measures and dimensions. This can be done in a few ways. Either create a blank YAML file, use the Add metrics view button, or "Generate Metrics with AI" from the model.
Create a Metrics view with Code
Copy the below into a blank YAML or use the Add -> metrics view to create a blank metrics view. Here you can start to define dimensions and measures as seen below.
# Metrics View YAML
# Reference documentation: https://docs.rilldata.com/reference/project-files/metrics-views
version: 1
type: metrics_view
model: example_model # Choose a model to underpin your metrics view
timeseries: timestamp_column # Choose a timestamp column (if any) from your table
dimensions:
- column: category
label: "Category"
description: "Description of the dimension"
measures:
- expression: "SUM(revenue)"
label: "Total Revenue"
description: "Total revenue generated"
For more information about available metrics view properties, feel free to check our reference YAML documentation.
Using the Visual Metrics Editor
When you add a metrics definition using the UI, a code definition will automatically be created as a YAML file in your Rill project within the metrics directory by default.

Creating a Metrics View with AI
In order to streamline the process and get to a dashboard as quickly as possible, we've added the "Create Metrics with AI" and "Create Dashboard with AI" options! This will pass your schema to OpenAI to suggest measures and dimensions to get started with Rill. You can define your own OpenAI key by creating a connector file. If you want to disable AI from your environment, please set the following in the rill.yaml
:
features:
ai: false