# Metrics

> Define revenue, churn and your other key numbers once, then certify them: simple, ratio and derived metrics, formats, lineage and history.

Source: https://tini.so/docs/metrics

A **metric** is one of your business numbers, defined once: Revenue, Average order value, Net revenue. Dashboards, notebooks, the agent and your AI assistant all use the same definition, so everyone gets the same number. You’ll find them under **Semantic layer → Metrics**.

## Three kinds of metric

| Kind | What it is | Example |
| --- | --- | --- |
| Simple | One measure from a data model, with an optional extra filter | Revenue = sum of paid order amounts |
| Ratio | One metric divided by another. Each is added up first, then divided, so it’s never an average of averages | Average order value = Revenue ÷ Orders |
| Derived | A formula over other metrics | Net revenue = Revenue − Refunds |

Metrics are built on [data models](https://tini.so/docs/data-models), so set one up first. For now, a ratio or derived metric can only be queried when all of its parts come from the same data model.

## Create a metric

1. **Start one**

   Go to **Metrics → New metric**. Or ask the agent: “Draft a revenue metric from paid orders.”

2. **Define it**

   On **Definition**, pick the kind. For a simple metric, choose the **Data model** and **Measure**, and add an **Extra filter** if you need one. For a ratio, pick the **Numerator** and **Denominator** metrics. For a derived one, write the **Formula**, inserting metrics by name.

3. **Describe it**

   On **Details**, give it a **Label** and a **Description**: say what it means and what it leaves out (“Paid orders, excluding refunds and tax”). Set how it’s shown (below).

4. **Create it and check it**

   Click **Create**. The **Explore** tab charts the metric over time from real data. Check it against a number you trust.

## Details

| Setting | What it does |
| --- | --- |
| Number format | Auto, number (1,234.5), compact (1.2K), percent (25%) or currency ($1,234), with the currency and decimals. Charts of the metric use it. |
| Good direction | Up is good, down is good, or neutral. Colors changes green or red, so a drop in churn shows as good news. |
| Default time grain | The step it trends by unless someone picks another: day, week, month, quarter or year. |
| Owner | Who to ask about this number. |
| Tags | Comma-separated labels for finding it, like `finance, kpi`. |

## Draft, certified, deprecated

Every metric has a status, shown as a badge wherever it appears:

| Status | Means |
| --- | --- |
| Draft | New or changed, and not vouched for yet. Everything the agent creates starts here. |
| Certified | Someone checked it and vouched for it. The agent prefers certified metrics. |
| Deprecated | Still works, but marked as on its way out. Point people to its replacement. |

- **Certify** appears on a saved metric that isn’t certified. The metric records who certified it and when.
- **Editing a certified metric’s definition sends it back to draft**, so a changed formula is never still vouched for by someone who checked the old one. Descriptions and formats can change without that.
- The **⋯** menu has **Return to draft**, **Deprecate** and **Delete metric**.

> **Note: Who can certify**
>
> Any member of your organization can create, edit and certify metrics. People certify; the agent and AI assistants can only draft.

## Lineage and history

- **Lineage** shows the data model the metric is built on, the metrics it uses, and the metrics that use it.
- **History** keeps every saved version, with who changed it and when. **Restore this version** brings an old one back.
- Renaming a metric updates the metrics and saved metric queries that refer to it.
- A metric that other metrics build on can’t be deleted. Saved queries that ask for a deleted metric stop working, so when a metric is in use, deprecate it rather than deleting it.

## Where metrics show up

- **Explore** tab on each metric: chart it by any time grain, split and filter it. See [Explore and query metrics](https://tini.so/docs/metric-queries).
- **Saved queries** and dashboards, as metric queries that follow the definition.
- **The Data Agent** checks your metrics before writing SQL, and says which one it used.
- **Claude and ChatGPT**, through the `list_metrics` and `query_metrics` [tools](https://tini.so/docs/connect-ai/tools).

> **Tip: A first set**
>
> For a subscription or online business, start with Revenue, New customers, Active customers, Churn rate and Average order value. That covers most Monday questions.

---

Previous: [Data models](https://tini.so/docs/data-models.md) · Next: [Explore and query metrics](https://tini.so/docs/metric-queries.md)

All docs: https://tini.so/llms.txt
