# Creating Metrics with the Formula Builder

A **metric** is a derived value: instead of being imported from a source like a measure, it is defined by a formula that combines your existing measures and metrics. Create a metric when you want to forecast, report, or adjust a ratio, margin, or other calculated figure.

## Create a metric

1. Click **Targets** in the sidebar.
2. In the **Metrics** section, click **Add**.
3. Enter a **Display Name**. Galdera fills in the **Technical Name** from it; you can change the technical name only while creating the metric.
4. Under **Formula**, use **Visual** to add operand chips, or use **Expression** to type a plain formula using the measures' and metrics' technical names (for example, `revenue / units_sold`). Use operators from one family: `+` and `−`, or `×` and `÷`. Add plain numbers where needed, for example × 365 or × −1.
5. In **Visual**, set an operand chip's **time shape** if it should read a period other than the current one, such as the previous period or year to date.
6. Check the **sentence preview** below the builder. That sentence is exactly what the formula means.
7. Click **Save**.

A metric can depend on both measures and other metrics, so you can layer calculations. For example, build a margin metric from revenue and cost measures, then a ratio on top of that margin metric.

For the full rules, such as why the two operator families can't be mixed, see [How Metrics Are Calculated](/data-model/metric-calculations).

## Time shapes

Each operand chip carries a **time shape**:

* This period (the default)
* Previous period
* Same period last year
* A trailing sum over N periods
* Year to date
* An average balance

Time shapes are how you build cross-period definitions, such as a depreciation rate (D\&A ÷ previous-period PP\&E) or DSO (AR ÷ trailing-12 Revenue × 365).

## Automatic recalculation

Because a metric is defined by its formula, it **recalculates automatically** whenever its inputs change, including when an overlay adjusts a measure it depends on. This is what lets an overlay on a measure flow through to every metric built on it. For how changes propagate through the model, see [Metric and Measure Dependencies](/data-model/dependencies).

## Measures come from your data

Measures usually aren't created with the formula builder: they appear in the **Measures** section when you import data from your [sources](/sources/what-is-source).
