Define Measures

What this covers
A measure is a named aggregation computed from a column, or from a user-defined attribute, of a fact table. Measures are the numeric values BI tools query — revenue, order count, average session duration, and so on. This article explains what constitutes a measure, how to define one in Model Builder, and the impact of choosing additive versus non-additive aggregation types on query routing.
Measure names must be unique within a model, ignoring letter case: you cannot create both Margin and margin. A refused create, rename or import leaves the existing definitions intact. Choose a distinct name explicitly; no measure or source backing is merged automatically.
The three properties of a measure
Every measure looks the same to a BI tool: a named numeric value. In the model it has three properties. They are independent of each other: knowing one tells you nothing about the other two. The measure drawer shows them as three separate lines, Backing, Time and Derivation.
Backing: physical or user-defined attribute
Backing says what the measure reads.
| Backing | What the measure reads | Example |
|---|---|---|
| Physical | A column of a source table. | SUM(amount) |
| User-defined attribute | An expression the modeller wrote on the table, stored on the model and treated as an ordinary column. | SUM(price * quantity * (1 + tax_rate)) |
A user-defined attribute is authored on the table, not on the measure: open the table on the canvas, click the Edit pencil and use the Attributes tab. See User-Defined Attributes. The measure then picks it in the Attribute list exactly as it would pick a column.
Time: standard or time variant
Time says whether the measure is shifted or accumulated across periods.
| Time | Meaning | Example |
|---|---|---|
| Standard | The measure is not a time variant. Its value is for the periods the query asks for. | revenue |
| Time variant | A time calculation over another measure (its base): prior year, year to date, moving average and so on. | revenue_prior_year, revenue_ytd |
A time variant is created from its base measure under Time Variants. See Configure Time Variants.
Derivation: plain, calculated or composite
Derivation says how the value is produced. It is the Derivation list in the drawer and it cannot be changed after the measure is created.
| Derivation | Meaning | Example |
|---|---|---|
| Plain | One aggregation over the measure's backing (a column or a user-defined attribute). | SUM(amount) |
| Calculated | An expression over other measures of the same model. | measure("revenue") - measure("cost") |
| Composite | A combination of measures from several models of the project. | Actual revenue from one model minus budget from another |
How the properties combine
- Backing applies to plain measures. A calculated or composite measure reads other measures, so the drawer shows its backing as not applicable.
- A time variant can be built on a plain measure of either backing. Its own derivation stays plain.
- "Standard" describes time only. A standard measure can be physical or attribute-backed, and plain, calculated or composite.
| Example measure | Backing | Time | Derivation |
|---|---|---|---|
revenue = SUM(amount) | Physical | Standard | Plain |
net_revenue = SUM(net_amount), where net_amount is a user-defined attribute | User-defined attribute | Standard | Plain |
revenue_prior_year | Physical | Time variant | Plain |
net_revenue_ytd | User-defined attribute | Time variant | Plain |
margin = measure("revenue") - measure("cost") | Not applicable | Standard | Calculated |
variance across two models | Not applicable | Standard | Composite |
What each property changes
| You want to | What decides it |
|---|---|
| Filter on the measure's grouped value (for example, revenue above 10,000) | Derivation: available for plain measures of either backing, including time variants; not available for calculated and composite measures. |
| See totals and subtotals in the Query panel and in Excel | Derivation and additivity: a plain additive measure is totalled directly; a plain non-additive measure (an average, a time variant) is totalled by a query at the total's own level; calculated and composite measures show no client-side total. |
| Use the measure inside a row-level expression or subquery | All three: only a plain, standard measure has a value per row. |
Importing models
An import file, a seed or an older export may label a measure physical. That word describes the backing, not the derivation. On import Tessallite stores such a measure as plain, provided it really reads a source column. If it does not (it has no source column, or it is defined by a user-defined attribute or an expression), the import is refused with a message that names the measure. Any other unknown measure type is refused the same way.
This page covers plain, standard measures.
Before you start
- You must have a model open in Model Builder with a source table added to the canvas. A single-table model is implicitly fact; a multi-table model must declare its fact table before deploy.
- The source column you want to aggregate must exist in the model's declared fact table (or its implicit single-table fact).
- Dimensions should be defined before you configure aggregates, because the aggregation type determines which grains Tessallite can serve from pre-aggregated summaries.
Measure definition fields
| Field | Required | Description |
|---|---|---|
| Name | Yes | Internal identifier used in SQL and API references. Must be unique within the model. |
| Display name | No | Label shown in the BI tool field list. Defaults to the name if left blank. |
| Source table | Yes | The fact table containing the column to aggregate. |
| Source column | Yes | The column to aggregate. For COUNT, use the primary key column. |
| Aggregation type | Yes | The SQL aggregation function to apply. |
| Default date dimension | With a semi-additive behaviour, and before creating time variants | The date the measure works from: the date that decides "last", "first" and the per-date totals of a semi-additive behaviour, and the date every time variant of the measure is calculated on. Chosen from the model's date dimensions; a time variant shows it read-only, inherited from its base measure. See Semi-Additive Measures. |
| Format | No | Presentation token controlling how Tessallite renders the value in the in-app Query panel. One of currency, percent, percent_2dp, integer, decimal_0, decimal_1, decimal_2dp, decimal_3, decimal_4, decimal_5, decimal_6. The token is stored on the measure and applied client-side; the underlying SQL value is unchanged. currency shows the model's currency (Model configuration → Regional), in the web app and in Excel. |
| Description | No | Free-text note exposed to BI tools that support field descriptions. |
Aggregation types
| Type | Additive | Use case | Example |
|---|---|---|---|
SUM | Yes | Totals of a numeric column | Total revenue, total quantity sold |
COUNT | Yes | Number of rows | Number of orders, number of sessions |
AVG | Yes | Mean of a numeric column | Average order value, average load time |
MAX | Yes | Highest value in a column | Latest event timestamp, highest sale price |
MIN | Yes | Lowest value in a column | Earliest order date, lowest recorded temperature |
COUNT DISTINCT | No | Number of unique values in a column | Unique customers, unique SKUs ordered |
The default date dimension
Every measure can name one Default date dimension. Most measures do not need it: a plain sum is the same whichever date a report uses. Set it when the measure's value depends on a date:
- a measure with a semi-additive behaviour (a balance, a headcount, a stock level) needs it to know which date is "last", and cannot be saved without it;
- a measure with time variants (year to date, prior year, lag, trailing and the others) needs it: every variant is calculated over this date, a variant cannot be created without it, and a variant has no date of its own. See Configure Time Variants.
The list offers the model's dimensions built on a date or timestamp column, or on a user-defined attribute of type date, on the measure's table or a table joined to it. A whole-number date key or a text date is not offered; create a user-defined attribute of type date that converts it, add it as a dimension, and choose that dimension. A model with several dates (transaction, posting, settlement) can give each measure its own; Tessallite never picks one for you. Semi-Additive Measures explains the choice with a worked example.
Additive versus non-additive measures
An additive measure can be correctly re-aggregated from a coarser pre-aggregated summary. If Tessallite has a daily SUM(revenue) summary by country, it can answer a weekly query by summing those daily rows — the data source is not touched.
COUNT DISTINCT is non-additive. Summing distinct counts from a daily summary does not give the correct weekly distinct count because the same value may appear on multiple days. Tessallite requires an exact grain match to serve a COUNT DISTINCT measure from a pre-aggregated table. If no aggregate exists at the requested grain, the Query Router falls back to executing the query directly against the fact table.
Note: Plan your aggregates explicitly for every grain you expect to query if you use COUNT DISTINCT measures. Without a matching aggregate, those queries always hit the data source at full cost.
Steps
- Open a model in Model Builder and click Measures in the Toolbelt (left sidebar).
- Click Add Measure. The Drawer (right panel) opens with a blank measure form.
- Enter a Name. Use business-readable terms — for example,
total_revenuerather thancol_amt_sum. BI tools surface this identifier to end users. - Select the Source table from the dropdown. Only fact tables already added to the model are listed.
- Select the Source column. The dropdown lists all columns in the selected fact table.
- Select the Aggregation type. If the column contains non-numeric values and you need a row count, use
COUNTon the primary key rather than the data column. - Optionally enter a Display name and Description.
- If the measure is a balance or another point-in-time value, set its Semi-additive behavior and its Default date dimension.
- Click Save. The measure appears in the Measures list in the Toolbelt and is available to the Query Router immediately.
Editing a measure
Click the measure name in the Toolbelt Measures list. The Drawer opens with the current values. Change any field and click Save.
Warning: Renaming a measure updates model-owned calculated-measure, KPI, scratchpad, saved SQL query and model alias-map references in the same transaction. Composite measures refer to measures by id and need no rewriting. A rename is rejected with the blocking object and JSON path if Tessallite cannot safely rewrite a stored name-based reference. Stable-ID consumers do not need rewriting. Quantile proof rows for that measure are invalidated so queries fail back to the source until the aggregate is refreshed or rebuilt. Deployed snapshots and external BI reports remain immutable, so reports or dashboards that reference the old name can still break; coordinate the rename and redeploy the model.
Deleting a measure
Open the measure in the Drawer and click Delete. Tessallite removes the measure from all aggregates that included it. Any aggregate that relied solely on the deleted measure will contain no measures and should be updated or deleted to avoid build errors.
When other objects depend on the measure. Tessallite checks what else uses the measure before it deletes it. If another object would stop working without it (a KPI or a named set that is built on it), the delete is refused and you change that object first. If the delete only changes or invalidates other objects (aggregates built for it, a persona that lists it, or its time variants, which are removed with it), a second dialog, Delete affects other objects, shows how many objects are changed or invalidated, how many are removed together with the measure, and the number per object type. Choose Delete anyway to delete, or Cancel to keep everything as it is. The same question is asked when the delete comes from Undo or from reclassifying a column in the table editor. The Impact Analysis panel lists each affected object; open it first when the numbers are larger than you expect.