Composite Measures
What this covers
A composite measure combines measures that live in different fact groups or different models — for example variance = payments − budget. This article explains when to use one, how to create it, and how Tessallite answers it.
When to use a composite measure
| You want | Use |
|---|---|
| A formula over measures of the same fact (margin %, average order value) | a calculated measure |
| A formula over measures of different fact groups or different models (actual vs budget, cost per onboarded customer) | a composite measure |
A composite measure is a measure like any other: Excel, Power BI, SQL clients, the REST API and the conversational agent all list it and query it by name. It replaces the older agent recipes.
Create a composite measure
- Open the home model in the Model Builder and choose Measures, then add a measure.
- Set the type to Composite.
- Under Operands, click Add operand and choose a Model and a Measure for each input. Operands may all come from other models in the project. Fact group is Automatic by default; choose a group when the measure is a calculated measure or its table is in more than one group (saving tells you when). Changing an operand's measure updates the expression to the new measure.
- Build the expression over the operands (for example operand 1 − operand 2) with the expression builder.
- Save and deploy.
For operands from different fact groups or models to line up by region, month or customer, the dimension must be shared: bind it as a conformed dimension. For a dimension of another model, Map here under Shared dimensions from other models suggests the matching dimension of this model, ranked on the data itself.
How it is answered
- Each operand runs as its own governed query, under the persona, column and row security of its own model. The composite value is then computed from those governed answers — it can never reveal rows an operand's security hides.
- A persona sees the composite in discovery only when the home measure and every operand can bind under that caller's persona in its own model. If any operand is unavailable when queried, the whole request is refused without returning a partial value.
- With a dimension in the question, operands are lined up on it; without one, the composite returns one total.
- Repeated questions reuse the operands' saved working results while they are fresh, so they come back faster; the numbers are the same.
Example (demo model Budget vs Actual): variance by region returns EMEA −300 and NA −250, and −575 in total.
Limits
- A grouped question supports one composite measure. An ungrouped grand total can place two or more composite and ordinary measure totals side by side; each is a separate governed answer.
- Combined queries refuse
SUM(DISTINCT ...),AVG(DISTINCT ...)and other aggregate DISTINCT expressions exceptCOUNT(DISTINCT ...). Ask for a supported aggregation or query one fact group separately. - A filtered composite total without grouping is refused; group by a shared dimension or remove the filter.
- Aggregates accelerate the governed operand queries. A composed answer cannot be built as one aggregate; build an aggregate for each operand instead.
- When a local dimension name differs from its shared dimension name, qualify the local field with its XMLA model catalog. If the tenant or project slug contains a hyphen, quote the catalog in SQL, for example
"acme-demo__project1__modely".channel_code. The result column keeps the local field name.