Semi-Additive Measures Across Semantic Model Formats: A Portability Test for Balances, MRR and Inventory
A semi-additive measure, such as an account balance, MRR or inventory on hand, sums across customers but not across time.

A semi-additive measure, such as an account balance, MRR or inventory on hand, sums across customers but not across time. Semantic model formats encode that rule differently, and converters can drop it. One reported dbt-to-Ossie import turns such a metric into a plain SUM. This test checks which formats and converters preserve it.
Here’s the failure that makes this topic urgent. In a discussion on the Apache Ossie dev list, Gareth reported a snapshot table where June monthly recurring revenue (MRR) is 24,200. Summing that metric across the days of June gives 695,900. No error. No warning. A number almost 29 times too large, delivered with full confidence to whoever asked.
Now put an AI agent in front of that semantic model. The agent asks for “MRR by month,” gets 695,900, and writes a cheerful summary about record revenue. The semantic layer was supposed to prevent exactly this kind of mistake. It does, if the semi-additive rule survives every step between where it was defined and where the query runs. That’s what this article tests.
Disclosure: I work at Dremio, which ships an AI Semantic Layer. This test covers open formats and converters, and the method applies to any semantic layer, including ours.
What Makes a Measure Semi-Additive
Measures come in three kinds, based on which dimensions you can sum them across.
Additive measures sum across every dimension. Revenue from orders is the classic case. Sum by day, by region, by product, and every total is correct.
Non-additive measures sum across no dimension. Ratios and percentages fall here. A conversion rate of 10% in one region and 20% in another doesn’t make 30% overall.
Semi-additive measures sum across some dimensions and not others. Almost always, the dimension you can’t sum across is time.
The examples are everywhere in business data:
- Account balances. Sum balances across accounts on one day and you get total deposits. Sum one account’s balance across 30 days and you get nothing meaningful.
- MRR from a daily snapshot. Each row is a customer’s MRR on a day. Sum across customers on one day and you get total MRR. Sum across days and you get the 695,900 problem.
- Inventory on hand. Sum across warehouses at a point in time, never across time.
- Headcount, open tickets, active subscriptions. Any “how many exist right now” count.
The pattern is the same in every case. The data is a snapshot table, one row per entity per point in time, and the measure describes a state rather than an event.
The Reduction Choice: Opening, Closing, or Something Else
When a query asks for a semi-additive measure at a coarser time grain, such as monthly MRR from daily rows, the semantic layer must pick one value from the period instead of summing. That choice is the reduction.
- Closing value. The value at the end of the period. Standard for balances and MRR.
- Opening value. The value at the start of the period. Used for “starting balance” reports.
- Average over the period. Used for average daily balance, which banks compute for interest.
- Minimum or maximum. Used for peak inventory or low-water marks.
Closing value is the most common choice. Even “closing value” hides a second decision that formats answer differently, and it’s the decision that makes portability hard.
The Hidden Second Decision
Take this daily MRR snapshot for one month, cut to four days so the arithmetic stays visible:
| Day | Customer A | Customer B | Customer C | Customer D |
|---|---|---|---|---|
| Day 1 | 100 | 200 | (none) | 80 |
| Day 2 | 100 | 200 | 50 | (none) |
| Day 3 | 120 | 200 | 50 | (none) |
Customer C joined on day 2. Customer D churned after day 1. What is closing MRR for the period?
Answer 1: total on the last date of the period. Find the last date with data, day 3, and sum all rows on that date. 120 + 200 + 50 = 370.
Answer 2: each customer’s last value, then sum. For each customer, take their latest row in the period. A: 120, B: 200, C: 50, D: 80 from day 1. Sum: 450.
The naive sum. Add every row: 380 + 350 + 370 = 1,100.
Answers 1 and 2 are both defensible. For MRR, answer 1 is usually right, because a churned customer contributes no revenue at period end. For inventory where some warehouses report less often than others, answer 2 is often right, because the latest reading per warehouse is the best estimate of what’s on hand. The naive sum is never right.
So a portable definition needs to say two things: which reduction to use, and whether to apply it to the period as a whole or per entity. Keep that in mind as we look at how each format encodes it.
How dbt MetricFlow Encodes It
dbt’s semantic layer, powered by MetricFlow, uses non_additive_dimension on a measure:
semantic_models:
- name: subscriptions
model: ref('mrr_daily')
defaults:
agg_time_dimension: snapshot_date
entities:
- name: customer_id
type: foreign
dimensions:
- name: snapshot_date
type: time
type_params:
time_granularity: day
measures:
- name: mrr
expr: mrr_value
agg: sum
non_additive_dimension:
name: snapshot_date
window_choice: max
- name: mrr_per_customer_latest
expr: mrr_value
agg: sum
non_additive_dimension:
name: snapshot_date
window_choice: max
window_groupings:
- customer_id
non_additive_dimension.name names the time dimension the measure must not sum across. window_choice picks the reduction: max for the end of the period, min for the start. window_groupings is the second decision. Without it, the reduction applies to the period as a whole, which gives Answer 1. With customer_id in window_groupings, the reduction applies per customer, which gives Answer 2. The first measure returns 370 for the example. The second returns 450.
One note for current dbt users. dbt’s documentation now marks measures as deprecated in favor of simple metrics under the metrics: key. Check the migration guide for how non_additive_dimension carries over before relying on it in the new spec.
How Snowflake Semantic Views Encode It
Snowflake added semi-additive metrics to semantic views in March 2026 with a NON ADDITIVE BY clause in CREATE SEMANTIC VIEW:
METRICS (
bank_accounts.m_account_balance
NON ADDITIVE BY (year_dim, month_dim, day_dim)
AS SUM(balance)
)
The clause lists the dimensions the metric must not be aggregated across, by their aliases from the DIMENSIONS clause. The example from Snowflake’s release note lists year, month, and day, so the balance never sums across any time grain. For the precise rules on which value is selected and how ordering applies, check the CREATE SEMANTIC VIEW reference, since the release note doesn’t spell them out.
How Databricks Metric Views Encode It
Databricks metric views express semi-additivity through window measures:
version: 1.1
fields:
- name: date
expr: snapshot_date
- name: customer
expr: customer_id
measures:
- name: closing_mrr
expr: SUM(mrr_value)
window:
- order: date
range: current
semiadditive: last
order names the field that orders the window, here the snapshot date. range: current restricts the window to a single date, so the measure sums across customers within each day. semiadditive says what to do when the query doesn’t group by the order field: last returns the most recent value, first the earliest. Databricks documents last as the default. For the example, grouping by month returns the day 3 total, Answer 1.
How Apache Ossie Is Approaching It
Apache Ossie is the open semantic model specification incubating at the Apache Software Foundation, aimed at moving semantic models between tools. Its draft doesn’t yet define a semi-additive construct. The dev list discussion in late November 2026 is where that’s being worked out.
The thread had three key contributions. Gareth reported the MRR example and noted that 195 metrics in the GASP test suite read snapshot tables, so this isn’t an edge case. JB Onofré suggested a split: the dataset declares its snapshot axis, and each metric chooses its reduction, such as closing or opening value. Justin Talbot invited the case to Ossie’s expression-language working group. GASP also added 15 conformance cases covering semi-additive behavior.
JB’s split is a clean design. The snapshot axis is a property of the data. A daily snapshot table has a daily snapshot axis whatever metrics sit on it. The reduction is a property of the metric. MRR wants closing, starting balance wants opening. Putting each fact where it belongs lets several metrics share one dataset definition with different reductions.
The open question, from the example above, is how Ossie will express the per-entity choice that dbt calls window_groupings. Without it, the spec captures Answer 1 and can’t faithfully represent models that rely on Answer 2.
The Converter Failure
On November 24, 2026, an issue was opened on the ossie-converters repository, #301: “[dbt] non_additive_dimension is dropped on import, so a semi-additive metric becomes a plain SUM.”
The report is precise. The dbt-to-Ossie converter discarded non_additive_dimension and exported the metric as a plain SUM. It raised no converter issue and added no entry flagging the metric as non-portable, so the output gave no sign anything was lost. In the reporter’s example, the converted metric returned 115 where MetricFlow’s semantics returned 55. The root cause was a check for non-portable semantics that covered windows, grain-to-date, offsets, time spine joins, and null filling, but not non_additive_dimension.
The issue was closed as completed on December 1, 2026. The fix commit’s title indicates the converter now drops semi-additive metrics on import instead of exporting them as a wrong SUM. Dropping a metric is a loss, but it’s an honest loss. A missing metric gets noticed. A wrong one gets used.
This is the most important lesson in the article. Silent semantic loss in a converter is worse than a failed conversion. Every converter should either preserve a semantic, flag it as non-portable, or refuse to convert it.
This Problem Is Older Than Any of These Formats
Semi-additive measures aren’t new. OLAP tools solved them decades ago, which is a useful reminder that the hard part today is portability, not the concept.
Microsoft SQL Server Analysis Services multidimensional cubes had semi-additive aggregation functions built into measure definitions, such as LastNonEmpty, FirstNonEmpty, LastChild, and AverageOfChildren. A modeler set the aggregation on the measure, and the cube applied it whenever a query rolled up over the time dimension.
Tabular models and Power BI moved the logic into DAX, the Data Analysis Expressions language. Functions like CLOSINGBALANCEMONTH, OPENINGBALANCEMONTH, and LASTNONBLANK let a modeler write a measure that picks the right value for any time context.
Notice that LastNonEmpty and LastChild already encode the hidden second decision. LastChild takes the last member of the time period whether or not it has data. LastNonEmpty takes the last member with data. Those map closely to the period-level and per-entity distinctions in the example, depending on how the cube was built. The industry has known about this choice for a long time.
What’s new is that semantic models now need to move between tools. A cube’s semi-additive setting lived inside one product. A dbt model’s non_additive_dimension has to survive a trip into Ossie and out to another engine. Every hop is a chance for the rule to vanish, which is exactly what issue #301 showed.
Average Daily Balance: The Reduction Most Formats Skip
Closing and opening values get all the attention. Average daily balance is just as common in finance, and it’s the reduction most semantic model formats don’t express directly.
Banks compute interest and fees on average daily balance. Subscription businesses compute average MRR for some board metrics. The rule is to sum across entities each day, then average those daily totals across the days in the period.
For the example data, the daily totals are 380, 350, and 370. The average daily MRR is 1,100 divided by 3, about 366.67. That’s different from closing (370), opening (380), and the naive sum (1,100).
-- Average of daily totals across the period
SELECT AVG(daily_total) AS avg_daily_mrr
FROM (
SELECT snapshot_date, SUM(mrr_value) AS daily_total
FROM mrr_daily
GROUP BY snapshot_date
) per_day;
The inner query sums across customers for each date, which is the additive direction. The outer query averages those daily totals, which is the semi-additive reduction. Swap the order, averaging per customer and then summing, and you get a different number whenever customers appear on different numbers of days.
Most formats handle this with a two-level metric definition, or with a derived metric on top of a daily total. That works inside one tool. It’s fragile across conversions, because the two levels have to survive together, in the right order. If you rely on average daily balance, add it to your portability test as T7, with an expected value of about 366.67 for the example data.
Designing Snapshot Tables That Keep Metrics Honest
Many semi-additive failures start in the data model, not the semantic layer. A few design rules prevent them.
Make the snapshot grain explicit. Name the date column for what it is, such as snapshot_date, and document the grain in the table comment. A semantic layer, a converter, or an agent reading the schema then has a fighting chance of recognizing a snapshot table.
Write complete snapshots. If an entity exists on a date, it has a row on that date, even when its value didn’t change. Gaps make period-level closing values undercount and push you toward per-entity reductions that hide data problems.
Write explicit zeros for churned entities, or stop writing rows. Decide which, and apply it consistently. A churned customer with a zero row on the last day gives the same closing total under both reductions. A churned customer with no row gives different totals, as the example shows.
Separate event tables from snapshot tables. Payments, orders, and logins are events and add up fine. Balances and MRR are states. Keeping them in separate tables keeps additive and semi-additive metrics from mixing on one dataset.
Partition snapshot tables by the snapshot date. In an Apache Iceberg table, partitioning by snapshot_date makes “rows on the last date of the period” a cheap query, because the engine prunes to one partition. That matters when a closing-value metric runs over a large table.
These rules also line up with the Ossie proposal. If the dataset declares its snapshot axis, a well-designed snapshot table makes that declaration obvious and correct.
The Portability Test
Here’s the test, as a reusable asset. It uses the four-day example above, so every expected answer is checkable by hand.
Test data. A table mrr_daily with columns snapshot_date, customer_id, and mrr_value, holding the rows from the example.
Test cases.
| Case | Query | Expected |
|---|---|---|
| T1 | Closing MRR for the period, period-level reduction | 370 |
| T2 | Closing MRR for the period, per-customer reduction | 450 |
| T3 | Opening MRR for the period, period-level reduction | 380 |
| T4 | MRR by day | 380, 350, 370 |
| T5 | Closing MRR by customer | A 120, B 200, C 50, D 80 |
| T6 | Naive SUM, to confirm the test detects it | 1,100 |
T3’s expected value is the day 1 total: 100 + 200 + 80. T4 checks that daily grain still sums across customers. T5 checks that grouping by the entity returns each customer’s latest value. T6 exists to prove the test catches the failure. A semantic layer that returns 1,100 for T1 fails.
The reference queries. Plain SQL that computes the expected answers directly from the table, so you can check any semantic layer against it:
-- T1: closing value, period-level (sum of rows on the last date)
SELECT SUM(mrr_value) AS closing_mrr
FROM mrr_daily
WHERE snapshot_date = (SELECT MAX(snapshot_date) FROM mrr_daily);
-- T2: closing value, per customer (each customer's latest row, then sum)
SELECT SUM(mrr_value) AS closing_mrr_per_customer
FROM (
SELECT mrr_value,
ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY snapshot_date DESC) AS rn
FROM mrr_daily
) latest
WHERE rn = 1;
-- T6: the naive sum the test must reject
SELECT SUM(mrr_value) AS naive_sum FROM mrr_daily;
T1 finds the period’s last date and sums every row on it. Churned customer D contributes nothing. T2 ranks each customer’s rows newest first and keeps only the latest before summing, so D’s day 1 value counts. T6 adds everything. On the example data, these return 370, 450, and 1,100.
How to run it. Define the metric in your semantic layer’s format. Query it at the period grain through the semantic layer’s own interface. Compare against the reference queries. Then convert the model to another format, query again, and compare again.
Results, Version 2026.12
Here’s what the documented behavior of each format and converter implies for the test, as of December 1, 2026. “Expressible” means the format has syntax for the case. It isn’t a claim about any particular deployment’s runtime behavior.
| Format or converter | T1 period-level closing | T2 per-entity closing | T3 opening | Silent loss risk |
|---|---|---|---|---|
| dbt MetricFlow | Expressible (window_choice: max) | Expressible (window_groupings) | Expressible (window_choice: min) | Low within dbt |
| Snowflake semantic views | Expressible (NON ADDITIVE BY) | Check reference | Check reference | Low within Snowflake |
| Databricks metric views | Expressible (semiadditive: last) | Not shown in docs example | Expressible (semiadditive: first) | Low within Databricks |
| Apache Ossie draft | Under discussion | Under discussion | Under discussion | Depends on converters |
| dbt to Ossie converter, before Dec 1 fix | Lost, exported as SUM | Lost | Lost | High, silent |
| dbt to Ossie converter, after Dec 1 fix | Metric dropped with non-portable flag | Dropped | Dropped | Low, loss is visible |
Read the last two rows together. Before the fix, every semi-additive metric came out wrong and looked fine. After the fix, it doesn’t come out at all, which is correct until Ossie can express it. That’s the trajectory you want: wrong, then missing, then preserved.
Guardrails for Agents That Query Balances
AI agents raise the stakes, because they query semantic layers without a human sanity-checking each number. A few guardrails help.
Mark semi-additive metrics in metadata the agent sees. If the semantic layer exposes metric descriptions to agents, say plainly that the metric is a period-end value and must not be summed across time.
Block time sums in the query layer. A semantic layer that knows a metric is semi-additive should refuse to sum it across time, not trust the caller.
Run the test after every model change and every conversion. Six queries take seconds. Make them part of CI for semantic models.
Watch for jumps of whole multiples. A semi-additive metric summed across days comes out roughly the number of days in the period times too large. The 695,900 vs 24,200 example shows a factor near 29. Alerting on period-over-period jumps of that size catches the failure even when the test misses a case.
Prefer refusal over guessing. If a converter or a semantic layer can’t express the reduction, it should drop or reject the metric. The December 1 fix shows this in practice.
Failure Modes and Warning Signs
Silent conversion loss. Warning sign: a metric’s value changes by a large multiple after a model conversion. Fix: run the test before and after conversion, and require converters to flag non-portable semantics.
Wrong reduction scope. Warning sign: closing values differ from finance’s numbers by the value of churned or non-reporting entities. Cause: period-level vs per-entity confusion. Fix: decide per metric, document it, and test with T1 and T2.
Gaps in snapshots. Warning sign: closing values dip on periods where the last day has missing data. Cause: period-level closing reductions use the last date with any data. Fix: complete snapshots, or a per-entity reduction where gaps are normal.
Agents summing across time. Warning sign: agent answers with suspiciously large balances. Fix: mark metrics, block time sums, and test.
Revision Policy
I’ll update the results table when Ossie defines a semi-additive construct, when a format documents per-entity reductions more clearly, or when converters change behavior. Each revision updates the version line at the top.
Changelog
- 2026.12 (December 1, 2026): first version. Four formats, one converter, six test cases.
Conclusion
Semi-additive measures are where semantic layers prove their value or fail quietly. Balances, MRR, inventory, and headcount all need a reduction instead of a sum across time, and the reduction itself hides a choice between period-level and per-entity closing values. dbt, Snowflake, and Databricks each express the core rule in their own syntax. Ossie, which aims to carry models between them, is still designing its construct, with a sensible proposal to separate the dataset’s snapshot axis from the metric’s reduction.
Converters are the weak point. Until December 1, the dbt-to-Ossie converter turned semi-additive metrics into plain sums without a word. The fix to drop them with a flag is the right interim behavior. Run the six-case test on every semantic model you own, before and after every conversion, and teach your agents that some numbers are never summed across time.
For the surrounding picture, see the Semantic Model Portability Scorecard, the Semantic Model Interchange Matrix, how relationship cardinality and join types break across engines, and how Apache Ossie is deciding what agents can ask a semantic layer.
Sources: Ossie dev thread on semi-additive measures and Apache Data Lakehouse Weekly, Nov 18 to 25, 2026 · ossie-converters #301 · dbt measures · Snowflake semi-additive metrics · Databricks window measures
Keep Going
If this piece was useful, I have written a lot more on semantic layers and AI-ready data. My books on lakehouse architecture and AI cover how semantic models, catalogs, and agents fit together. You can find every book I have written, across lakehouse architecture, Apache Iceberg, Apache Polaris, and AI, at books.alexmerced.com.


