Skip to main content

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 budget gets its own set of variance rows, tagged budget_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​

MeasureFormulaNotes
actual_amountΣ actual rows
budget_amountΣ budget rows of the chosen scenarionull when the grain has no budget line (not 0)
variance_absactual_amount − coalesce(budget_amount, 0)Default for K.EPM_VARIANCE
variance_pct(actual_amount − budget_amount) / abs(budget_amount) × 100null when budget is null or 0
variance_favorablesee below1 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​

Conditionvariance_favorable
budget_amount is null0
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​

TestAssertion
assert_variance_abs_formulavariance_abs = actual − budget within 0.01
assert_favorable_revenueRevenue, actual > budget → favourable
assert_favorable_expenseExpense, actual < budget → favourable
assert_variance_budget_matches_yearA budget scenario is only compared with the entity-years it budgets
assert_variance_covers_budget_scenariosEvery active budget scenario has its own complete row set
assert_scenario_rows_declaredEvery 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")
ArgumentEffect
period1–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).
dimensionsFilter 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
scenarioIdFilters on budget_scenario_id; required when more than one budget scenario is active
hierarchy, nodeRead 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):

ColumnMeaning
ytd_actualΣ actual through this period
ytd_budgetΣ budget through this period; null until the first budget line of the year
ytd_variance_absytd_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:

ColumnFormula
current_amountthis year's period_net_amount
prior_year_amountsame entity, account, dimensions and period, fiscal_year − 1; 0 if none
yoy_variance_abscurrent_amount − prior_year_amount
yoy_variance_pct(current − prior) / abs(prior) × 100; null when prior is 0 or missing

A variance report in Excel​

ABCDE
1Entity:USMFYear:2025
2AccountActualBudgetVarianceFav?
34100=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")
46100…………

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​