# How Metrics Are Calculated

A metric is calculated from a formula that combines measures, other metrics, and plain numbers. Knowing which formulas Galdera accepts, and how it evaluates them, helps you define a metric correctly the first time.

## Operators

A formula chains any number of operators from **one family**, evaluated left to right:

| Family | Operators | Example |
| --- | --- | --- |
| Additive | `+` and `−`, in any mix | Invested Capital = Debt + Equity − Cash |
| Multiplicative | `×` and `÷`, in any mix | EBITDA Margin = EBITDA ÷ Revenue × 100 |

You can't mix the two families in one formula: `Revenue + Units × 2` is rejected. When a calculation needs both, give the intermediate step its own metric, with a name someone would say out loud. For example, to calculate NOPAT = EBIT − Taxes on EBIT, define *Taxes on EBIT* as its own metric first.

Formulas can also include plain **numbers**, for example × 365, or × −1 to flip a sign.

## Points in time

Each operand can read its input at a different **point in time**:

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

The same input can appear twice at different times. Depreciation = PP\&E − previous-period PP\&E reads one measure at two times; it is not two inputs. This is what makes balance-sheet and cash-flow formulas possible.

## Formulas read as sentences

Build a formula with operand chips in **Visual**, or type a plain formula using technical names in **Expression**. Use **Visual** for time shapes such as trailing periods. The formula preview uses display names, for example "DSO = Accounts Receivable ÷ Revenue (trailing 12 periods) × 365". To build one, see [Creating Metrics with the Formula Builder](/targets/creating-metrics).

## Automatic recalculation

Metrics recalculate automatically when any of their inputs change, including when overlays adjust the underlying measures. For example, a 10% scale on Subscription Revenue flows through to Gross Profit, Gross Margin, and every other metric that depends on it. You don't need to update derived metrics by hand.
