10.1 Understanding Metrics¶
A metric represents data from your database that is aggregated, i.e. summarized in some form. A typical example would be a "Turnover" metric that summarizes sales amounts from your invoice lines. Metrics can be combined into other metrics, such as ProfitMargin, which can be calculated as the metric Turnover minus the metric CostAmount.
Metrics are an integral part of your BI system's data model. They complement the Dimensions that represent categorical data, such as Customer and Item.
A metric is defined as an aggregation of a measure in your data, for example sum of sales amount, which would be the Turnover metric.
Metrics are also sometimes referred to as KPIs (Key Performance Indicators), but we'd consider that a subset of metrics, with metric being the more general/generic term and a KPI being something defined on an organizational level for measuring the organization's performance.
Typical metrics include:
- Turnover
- Cost amount
- Profit margin
- Customer Churn
- Sold quantity
- Number of buying customers
- Inventory value
- Inventory quantity
- Fiscal amount
Kinds of Metrics¶
Every metric is one of two kinds:
| Kind | What it does | Example |
|---|---|---|
| Aggregation | Summarizes a source with a function such as SUM or COUNT. The source is a fact, a table column or a dimensional unit. | Turnover = SUM of the invoice amount; Customer count = COUNT of customers |
| Expression | Calculates with other metrics using + − * / and parentheses | Contribution margin = Turnover - Cost |
Metrics are shared by the whole project. When you add a metric to a visual, the visual gets its own column that refers to the metric – so you can format or transform the column without changing the metric for anyone else. See 10.2 Using Existing Metrics.
Common Issues – Understanding Metrics¶
Problem: Distinguishing between dimensions and metrics is sometimes abstract and difficult.
- Solution: Think of dimensions as something you'd typically group by or filter on, e.g. Item or Customer, whereas metrics are usually a SUM or a COUNT of something.