Metric Formula How It Works
How Calculation Runs
What the platform does once a formula exists, and how to tell whether a run worked.
What triggers a recalculation
- Saving a cell on a sheet
- Publishing a formula change
- A data upload or an integration load
- Copying a version or scenario
- A master-data change that affects the model
- A consolidation or close step
- A scheduled job or an automation rule
You can also start one: Rerun Metric recalculates a metric and replaces its calculated values, and Re-Calculate Metrics recalculates metrics on demand.
Not on report render:Opening a report does not run a calculation. Reports read the stored values of Input and Formula metrics, so they show the result of the last successful run. If a run failed, the report shows the figures from before the failure. See How Metric Values Are Stored.
Order is worked out for you
If metric B feeds metric C, B is calculated first. There is no solve-order field on a metric formula: the platform reads the definitions and runs them in dependency order.
Volume ----+
+---> Revenue ----+
Unit Price -+ +---> Gross Margin ---> Margin %
|
Cost of Sales ----------------+
Run order: Volume, Unit Price, Cost of Sales (entered)
then Revenue
then Gross Margin
then Margin %
You can add a step in the middle of a chain, or split one formula into two, without setting any order.
One thing you cannot do: A formula cannot depend on itself. The save is rejected with “Circular reference found for below metric(s): …”, naming the metrics in the loop. The exception is a period-over-period rollforward .
Only the affected slice is recalculated
The platform tracks which members a change touched, narrows the work to those, and narrows again for each downstream metric. A metric that is not affected is skipped.
- A cell edit recalculates only what it touched.
- A formula publish is not a data change, so it runs over the scope you chose at publish time. That is why the scope choice on Publish Changes matters.
Where to check a run
Open the Task Monitor (Explorer → Governance → Monitor → Task Monitor). Each run shows its status; the detail pane is labelled Calculation Log. You can stop a running calculation there.
Status |
Meaning |
|---|---|
In-Progress |
Running. |
Success |
Every metric in scope completed. |
Failed |
One of three things: a metric failed to calculate; the run was still In-Progress after the maximum run time (2 hours by default) and shows “Auto failed by the batch because the calculation execution exceeded the maximum elapsed time”; or a user stopped it from the Task Monitor, which shows “Process killed on User Request”. Values already written stay as they are. |
When a run fails
A failed run can leave mismatched data: If one metric fails, it is recorded as failed and the run carries on. The metrics after it, including ones that depend on it, still run against whatever the failed metric last held. Each metric's results are saved as it finishes; nothing is rolled back. The run ends as Failed.
So some metrics are recalculated and others are not. The sheet looks normal.
- Check the status in the Task Monitor, not the sheet. A populated cell does not mean the run succeeded.
- Read the message. It names the failed metric: “Failed to calculate metrics:”, then <sheet>.<metric> and “Reason: …” on separate lines. When publishing one metric it can read “Failed to calculate metric:”.
- Fix the cause — usually a formula problem, a missing input, or a data type mismatch.
- Rerun. Downstream figures do not recover on their own.
Put this in the close checklist: “Check the run status in the Task Monitor after each data load.”
Two guard rails
Overlapping runs are refused
A rule calculation submitted from a process task does not start while another runs over the same dimension context — “Please wait for previous calculation to be complete”. A metric's details cannot be saved while it is publishing — “Metric Publish is in progress. Please try again later”.
Big changes are flagged first
Before a formula change is applied, the query is trial-run and the impacted records counted, so a syntax or type error, or an unexpectedly large impact, shows before anything is written.
Performance and Limits
A formula's cost depends mostly on how many intersections it touches, not on how complex the arithmetic is. Four changes can reduce it.
The message you will see first
When you save a change to a Formula metric and the formula produces more than 50,000 records, you see:
Update formula will impact 384,220 records.
(Please consider formula optimization function such as Lookup, Applicable to... if relevant)
It is a warning, not a block. You can confirm and continue — for example on a first load of several years of history — or cancel, which keeps the previous formula. Treat it as a prompt to check the formula.
Why a formula gets expensive
Every matched dimension multiplies the work. Inputs that share dimensions with the output across 300 products, 12 periods, 12 entities and 3 scenarios cover about 130,000 intersections before any arithmetic. Each change below reduces the intersections or the dimensions being matched.
Four changes
1. Make reference inputs Lookup
Lookup
Make an input that is a rate, factor or standard costLookup rather than
Sum. A Lookup input is matched only on the dimensions it shares with the output, is repeated
across the rest, and does not decide which rows exist. The message above also names Lookup.
Keep at least one input non-Lookup
(Formula Functions).
2. Set Applies To
Applies To
Setting Applies To limits which members are calculated. Click Update List under Applies To, choose the dimension, and select only the members that need the calculation. See Configure Metric Settings.
3. Pin dimensions that do not vary, with Filter
Filter
Where a rate is held at one currency, scenario or period, make the input Lookup and pin
that dimension with Filter. On a Lookup input, Filter takes the dimension out of
matching; on a Sum input it only limits which rows are read..
4. Split a wide formula into stages
Replace one formula with eight inputs by two simpler Formula metrics, one feeding the other. Run order is worked out automatically, and the intermediate figure is visible, which helps when debugging.
Rollforwards and publish scope
A rollforward is replayed once per period in scope, so republishing one over three years of monthly data is thirty-six passes. .
Reading the impacted-record count
The count is… |
What it probably means |
|---|---|
Roughly what you expected |
Publish. |
Orders of magnitude larger |
A driver that should be |
Very small, or zero |
The formula may be scoped too narrowly, or an input has no data at those intersections. |
Two limits to know
Maximum run time: A calculation still In-Progress after the maximum run time (2 hours by default) is marked Failed in the Task Monitor with “Auto failed by the batch because the calculation execution exceeded the maximum elapsed time”. This changes the status only; values already written stay as they are. Fix the cause before you rerun.
Record volumes: There is no record limit that stops a calculation. Test heavy chains at realistic volumes.
Decide grain before you build
Build at the coarsest correct grain: Before building a formula, ask what the coarsest grain is at which the answer is still correct, and build it there. A metric calculated by SKU and month but only reported by brand and quarter calculates more intersections than the report needs.
What You Can Trace
Three tools tell you what happened to a calculation, each answering a different question. Together they cover the rule and the run — but not the individual cell.
The three tools
Tool |
Answers |
What it holds |
|---|---|---|
Task Monitor (Calculation Log) |
“Did it work?” |
Status, trigger, progress, duration, who submitted it, records written per sheet, and the message, including failed metrics by name. |
Metric Formula History |
“What changed, and when?” |
Old formula, new formula, version number, and publish option. Definitions only — a data change never creates a record here. |
Run trace |
“What ran, and how fast?” |
Per metric: position in the dependency order, start and end times, records calculated and written, timings, and the formula that ran. Exported as a workbook. |
The trace is not retrospective. It is a per-user session with a time window: switch it on, run the calculation, then read the export.
What you can show an auditor
The rule
Metric Formula History shows the formula text in force at any point, who changed it, and the scope they published over.
The run
The Task Monitor shows that the calculation ran, when, on whose action, and with what outcome.
The individual number
You cannot click a calculated cell and see the input values that produced it.
The gap: no cell-level lineage
Know this before an audit:You cannot drill from a calculated value back to the input values that produced it.
The run trace records the scope a formula ran over — roughly “this formula ran across these members and wrote N rows” — not “this cell equals this input times that input”. It answers performance and completeness questions, not “why is this number what it is?”
What to do instead
- Name the intermediate steps. Split a wide formula into stages with clear names — Goods Available for Sale, Gross Contribution. Each becomes a visible column a reviewer can follow. Run order is worked out automatically.
- Keep the inputs on the sheet. Inputs in adjacent columns explain the result; inputs read from three other sheets do not.
- Use the Metric Tree. It shows which metrics feed which. Where Used shows the reverse — what depends on this metric.
What is versioned and what is not
Formula text |
Versioned in Metric Formula History, with the publish option used. |
Calculated values |
Not versioned. No undo: to revert, republish the earlier formula over the same scope, so note your scope before publishing (Publish Changes). |
Entered values |
Input metrics have their own data history. |
Who changed what
Every write records who made it and when, and the Task Monitor records who submitted each run. So you can find the run that wrote a value, and the person and trigger behind it — but not which input moved the number. A failed run is visible only in the Task Monitor, not on the sheet (How Calculation Runs).