Budget variance analysis in Power BI with DAX

How to build budget against actual reports in Power BI, a budget table at month and account grain, variance and variance % with the right sign for revenue and costs, favourable and unfavourable, year to date and full-year forecast, a variance waterfall by cost centre, and the DAX with TREATAS.

Short answer: budget variance = actual - budget, per account and period. Load the budget as its own table (Year Month, Account, Cost Centre, Amount), connect it to the report with TREATAS or shared dimensions, and add Variance, Variance % and a favourable flag that knows the account type: more revenue than budget is favourable, more cost is unfavourable. Show year to date against budget, and a forecast (actual to date + budget for the remaining months) against the full-year budget.

Finance teams spend days on this in spreadsheets each month. In a model with one budget table and five measures, it updates with every refresh.

How does a budget report look?

LineActualBudgetVarianceVariance %Favourable
Revenue9,1509,000+150+1.7%yes
Cost of goods sold5,5805,400+180+3.3%no
Staff1,4201,450-30-2.1%yes
Marketing610540+70+13.0%no
Rent and other33033000.0%yes
Operating profit1,2101,280-70-5.5%no
September year to date (k)
05001,0001,5001,280Budget+150Revenue-180Cost of goods sold+30Staff-70Marketing1,210Actual
Operating profit, budget to actual (k)

The waterfall shows each line's effect on profit: favourable variances go up, unfavourable go down.

What is the DAX?

Accounts has a Type column (Revenue or Cost). Actuals come from the ledger, the budget from its own table.

Actual = SUMX ( GL, GL[Amount] * RELATED ( Accounts[Sign] ) )

Budget =
CALCULATE (
    SUM ( Budget[Amount] ),
    TREATAS ( VALUES ( 'Date'[Year Month] ), Budget[Year Month] )
)

Variance = [Actual] - [Budget]

Variance % = DIVIDE ( [Variance], [Budget] )

-- positive when good for profit, for colours and the waterfall
Profit Impact =
SUMX (
    VALUES ( Accounts[Type] ),
    IF ( Accounts[Type] = "Revenue", [Variance], - [Variance] )
)

Favourable = IF ( [Profit Impact] >= 0, "yes", "no" )

Budget[Account] and Budget[Cost Centre] relate to the Accounts and Cost Centre dimensions directly (the budget's grain matches them); only the date grain differs, which is what the TREATAS on Year Month handles. See actual vs target for the general pattern.

How do you add year to date and a forecast?

Actual YTD = CALCULATE ( [Actual], DATESYTD ( 'Date'[Date] ) )
Budget YTD = CALCULATE ( [Budget], DATESYTD ( 'Date'[Date] ) )

Last Closed Month = CALCULATE ( MAX ( GL[Date] ), ALL ( GL ) )

Forecast FY =
VAR Closed = EOMONTH ( [Last Closed Month], 0 )
VAR Yr = YEAR ( Closed )
VAR ActualPart = CALCULATE ( [Actual], 'Date'[Year] = Yr, 'Date'[Date] <= Closed )
VAR BudgetRest = CALCULATE ( [Budget], 'Date'[Year] = Yr, 'Date'[Date] > Closed )
RETURN ActualPart + BudgetRest

Budget FY = CALCULATE ( [Budget], ALL ( 'Date' ), 'Date'[Year] = YEAR ( [Last Closed Month] ) )

Forecast against Budget FY answers "where will we land if the rest of the year goes to plan?". Replace the budget part with a re-forecast table when finance updates it.

What goes wrong?

  • Signs. Revenue and cost variances need opposite colours; use Profit Impact for formatting.
  • Budgets at a different grain. A yearly budget on a monthly report needs phasing (by month weights), not a twelfth each, if the business is seasonal.
  • Budget versions. Keep a Version column (Budget, Forecast 1, Forecast 2) and select one, or totals add versions together.
  • Open months. Comparing the current, unfinished month to its full budget always looks bad; stop actuals at the last closed month.

Where can you check this?

Where do you start?

Load next year's budget as a table at month, account and cost centre, then build the five measures and the waterfall. Profit margins shows the P&L structure to put them on.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.