FP&A variance and forecast
Public sample data · Microsoft AdventureWorks
Problem
To learn FP&A analysis end to end, I built a budget versus actual dashboard on AdventureWorks, Microsoft’s sample data for a fictional bike manufacturer, and wrote up what I found on LinkedIn, mistakes included.
The five questions I asked
- Variance: how does actual spending compare to budget by account, and which accounts vary most?
- Trend: how have revenue and expenditures moved year over year, and is the gap widening?
- Mix: which account types take the largest share, and has the mix shifted?
- Consistency and health: which results hold year after year, and what do the balance sheet ratios say?
- Forecastability: which accounts follow a predictable pattern, and which are too volatile to forecast?
Data
The AdventureWorksDW sample database in SQL Server: actuals by account for 2010 to 2013, with budgets for 2010 and 2011 only.
Approach
- Queried the finance tables in SQL Server and modeled them in Power BI.
- Built DAX measures for actual versus budget variance and a run rate forecast for 2012 and 2013.
- Checked the shape of the data before trusting the answer, and corrected my own posts when it was wrong.
- Built the SQL and DAX with AI assistance, then read and tested every query and measure myself.
What I caught
- Wrong period count. The first result showed accounts 265% to 658% over budget, because four years of actuals were summed against two years of budgets. A measure that counts actuals only in budgeted years fixed it.
- A blank read as zero produced a false $5.46M swing until an
ISBLANKcheck fixed it. - Four data-shape problems: a one-month year, a missing December, snapshot balance-sheet accounts, and zero rollup accounts. On a like-for-like January to November basis, net margin slid from 21.2% to 19.2%.
Results
A backtested forecast (2013 predicted as 2012 plus the prior year’s change) landed within 3.1% in total while missing many individual accounts. It is one test point per account, and a lesson about totals hiding detail.



A deeper model
I then had Claude (AI) profile the whole database before modeling and rebuild the model from what it found. Every amount is in USD, returns and discounts are netted out of sales, intercompany sales are shown separately, and each posting sits in its true month. The results match SQL Server to the dollar. On that basis, gross margin rose from 2011 to 2013, but operating margin fell from 26.4% to 22.0% (January to November each year), because operating expenses grew faster than sales. The SQL, DAX and a checklist of what to verify are in the repo’s deeper-model folder.





Tools
SQL Server (SSMS) · Power BI · DAX
Write-ups
Repo
The DAX
All 35 measures, exported straight from the model: fpa-measures.dax. The fix for the period-count error is the pair Original Variance (actuals against budget) and Variance (comparable actuals against budget), kept side by side on purpose.
Data source
The AdventureWorks sample databases are free from Microsoft, so anyone can rebuild this analysis.