Variance Analysis Guide
Konsolidat compares actuals against each declared budget scenario and marks every line favourable or not. Excel reads the result with =K.EPM_VARIANCE().
Data flow
graph LR
TB[gold_trial_balance<br/>actuals from the GL] --> STB[gold_scenario_trial_balance]
SB[gold_spread_budget<br/>layers summed] --> STB
D365[silver_budget_entries<br/>D365 budget register] --> STB
SD[Scenario doctype<br/>scenario_type, is_active] --> VAR
STB --> VAR[gold_variance_analysis]
VAR --> VYTD[gold_variance_ytd]
STB --> VQ[gold_variance_quarterly]
VAR --> VN[gold_variance_at_hierarchy_node]
VAR --> XL[K.EPM_VARIANCE<br/>Dataset variance_analysis]
Which scenarios are compared
The warehouse never reads a scenario code. It reads the Scenario doctype (konsolidat#206):
- Actuals are the rows of the single active scenario of type
actual. - Every active scenario of type
budgetgets its own set of variance rows, taggedbudget_scenario_id. The actuals are repeated against each budget that has lines for the same entity and fiscal year. Two budgets are never added together. - An actual that no budget scenario covers appears once with
budget_scenario_id = ''and no budget. - Forecast scenarios never reach the variance models.
With one active budget scenario you can ignore budget_scenario_id. With two, pass scenarioId in Excel to choose.
Measures
| Measure | Formula | Notes |
|---|---|---|
actual_amount | Σ actual rows | |
budget_amount | Σ budget rows of the chosen scenario | null when the grain has no budget line (not 0) |
variance_abs | actual_amount − coalesce(budget_amount, 0) | Default for K.EPM_VARIANCE |
variance_pct | (actual_amount − budget_amount) / abs(budget_amount) × 100 | null when budget is null or 0 |
variance_favorable | see below | 1 favourable, 0 otherwise |
Amounts are signed as in the trial balance (period_net_amount = debit − credit). A revenue account carries a negative balance; "actual > budget" is evaluated on those signed numbers.
Favourable or not
| Condition | variance_favorable |
|---|---|
budget_amount is null | 0 |
account is not P&L (is_pnl = 0) | 0 |
account_type_name = 'Revenue' | 1 when actual > budget |
account_type_name = 'Expense' | 1 when actual < budget |
any other account type (including the generic Profit and loss) | 0 |
account_type_name is the konsol group chart's vocabulary. If your chart uses other type names, no line is marked favourable.
Tests
| Test | Assertion |
|---|---|
assert_variance_abs_formula | variance_abs = actual − budget within 0.01 |
assert_favorable_revenue | Revenue, actual > budget → favourable |
assert_favorable_expense | Expense, actual < budget → favourable |
assert_variance_budget_matches_year | A budget scenario is only compared with the entity-years it budgets |
assert_variance_covers_budget_scenarios | Every active budget scenario has its own complete row set |
assert_scenario_rows_declared | Every scenario with rows is declared, active and of the right type |
Reading variance in Excel
=K.EPM_VARIANCE("USMF", 2025, 5, "6100")
is the same as
=K.EPM("USMF", 2025, 5, "6100", "variance_abs", "variance")
Other measures through K.EPM with scenario "variance":
=K.EPM("USMF", 2025, 5, "6100", "actual_amount", "variance")
=K.EPM("USMF", 2025, 5, "6100", "budget_amount", "variance")
=K.EPM("USMF", 2025, 5, "6100", "variance_pct", "variance")
=K.EPM("USMF", 2025, 5, "6100", "variance_favorable", "variance")
| Argument | Effect |
|---|---|
period | 1–12, Q1–Q4, H1–H2, FY. Ranges sum the measure across periods (so a summed variance_pct is not meaningful; compute it from the summed amounts instead). |
dimensions | Filter on the site's dimensions: one text cell such as "dim_region=EU;dim_product=X", or a 2-column range of name/value rows. See Dimensions |
scenarioId | Filters on budget_scenario_id; required when more than one budget scenario is active |
hierarchy, node | Read gold_variance_at_hierarchy_node for a management rollup |
Year-to-date: gold_variance_ytd
Running totals within each (entity, year, account, dimensions, budget_scenario_id):
| Column | Meaning |
|---|---|
ytd_actual | Σ actual through this period |
ytd_budget | Σ budget through this period; null until the first budget line of the year |
ytd_variance_abs | ytd_actual − coalesce(ytd_budget, 0) |
ytd_variance_pct | (ytd_actual − ytd_budget) / abs(ytd_budget) × 100 |
Quarterly: gold_variance_quarterly
Same pairing, grouped by fiscal_quarter from gold_period_hierarchy: actual_amount, budget_amount, variance_abs, variance_pct, budget_scenario_id. It has no favourable flag.
Management rollups: gold_variance_at_hierarchy_node
Rolls actual_amount, budget_amount and variance_abs up every node of a published reporting hierarchy, per budget_scenario_id, with the tree resolved as it stood at each period's end date. assert_variance_node_single_budget ties the node sums back to the flat model.
Prior year: gold_prior_year_comparison
Year-over-year on actuals only, from gold_trial_balance:
| Column | Formula |
|---|---|
current_amount | this year's period_net_amount |
prior_year_amount | same entity, account, dimensions and period, fiscal_year − 1; 0 if none |
yoy_variance_abs | current_amount − prior_year_amount |
yoy_variance_pct | (current − prior) / abs(prior) × 100; null when prior is 0 or missing |
A variance report in Excel
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Entity: | USMF | Year: | 2025 | |
| 2 | Account | Actual | Budget | Variance | Fav? |
| 3 | 4100 | =K.EPM($B$1,$D$1,"FY",$A3,"actual_amount","variance") | =K.EPM($B$1,$D$1,"FY",$A3,"budget_amount","variance") | =K.EPM_VARIANCE($B$1,$D$1,"FY",$A3) | =K.EPM($B$1,$D$1,"FY",$A3,"variance_favorable","variance") |
| 4 | 6100 | … | … | … | … |
Conditional formatting on column E: 1 green, 0 red. Note that FY sums variance_favorable across twelve periods, so for a full-year flag read period-level values or compare columns B and C.
Next steps
- Budgeting Guide — where budgets come from
- Budget Layers Guide — layered entry and a worked variance example
- Report Catalog — every gold model
- Variance Model design — the SQL