BASF Controlling Dashboard
An interactive financial-analysis dashboard that reads BASF’s published annual
reports and delivers the analysis a controller actually does — segment
performance, year-over-year variance, capital efficiency, and an EBIT bridge.
Not a trading app — a management-reporting tool.
Built as a portfolio project to demonstrate financial-controlling competence
together with a modern Python data stack (Streamlit · pandas · Plotly).

What it is
The dashboard ingests BASF’s own investor-relations data (the published
“Selected Tables” workbooks) and turns it into a navigable, BI-style report.
Everything runs fully offline from local data — no API keys, no live calls
during a demo — so it loads instantly and behaves deterministically.
It answers the questions a Junior Controller is expected to handle:
- How did each segment perform on revenue, EBIT and margin?
- What drove the year-over-year variance — and where, by driver?
- Is the group using its capital efficiently (ROCE, asset turns, CAPEX)?
- How does BASF look against the market and the macro backdrop?
Pages
| # |
Page |
What it shows |
| 1 |
Group Overview |
Headline KPIs (sales, EBIT, margin, FCF) and group-level trend |
| 2 |
Segment Analysis |
Revenue, EBIT margin, contribution and trend by operating segment |
| 3 |
Variance |
YoY variance tables by segment and metric (absolute + %) |
| 4 |
Capital Efficiency |
ROCE, asset turnover and invested-capital efficiency |
| 5 |
Variance Bridge |
EBIT waterfall: FY-to-FY walk decomposed by segment driver |
| 6 |
Market Context |
BAS.DE vs. benchmarks indexed to 100, plus valuation multiples |
| 7 |
Macro Context |
Macro indicators and events framed against BASF’s results |
| 8 |
Cash Flow |
Operating / free cash flow and the FCF build |
| 9 |
Profitability Simulation |
Driver-based gross-profit (PVC) what-if model |
Tech stack
The stack is deliberately small — single-command local app, zero front-end code,
no database — chosen so a reviewer can clone and run it in under a minute.
| Technology |
Version |
Role |
Why |
| Python |
3.12 |
Runtime |
Stable sweet spot for the whole stack below |
| Streamlit |
1.58 |
UI framework |
streamlit run app.py is the entire deploy story; native widgets cover every filter with no JS; st.cache_data makes interactions instant |
| Plotly |
6.8 |
Interactive charts |
Hover/zoom/legend toggling out of the box — the “management report” feel; first-class waterfall + indexed-line chart types |
| pandas |
3.0 |
Data wrangling |
Pivot / groupby / YoY-QoQ math for tabular financial analysis; Copy-on-Write by default for clean, low-memory loads |
| openpyxl |
3.1 |
.xlsx reader |
pandas’ default engine for the BASF report workbooks |
| yfinance |
1.4 |
Market data |
Free, no API key, covers BAS.DE and the benchmarks; fetched once into a committed snapshot for offline demos |
| pytest |
8 |
Tests |
Golden-value tests pin the financial figures so refactors can’t silently change the numbers |
Why these choices (and not others)
- Streamlit over Dash/Gradio — the constraint is “local, single-command,
BI feel.” Streamlit ships the same Plotly charts with a fraction of the code.
- Plotly over Matplotlib — interactivity (hover/zoom) is the whole point of
a management report; static charts would kill the feel.
- Local snapshot over live API — the market data is fetched once and
committed under
data/, so a flaky network never breaks a live presentation.
Getting started
# 1. create the environment (first time only)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
# 2. run the dashboard
streamlit run app.py
The app opens in your browser and runs entirely from local data — no network
required. Financial figures come from the BASF report tables in
basf anual reports/; the market snapshot is committed under data/.
Refreshing the market snapshot (optional)
The market data is committed, so you never need this for a demo. To update it
with fresh prices while online:
python scripts/fetch_market_snapshot.py # the ONLY step that touches the network
Tests
pytest
Project structure
app.py # Home page (Group Overview) + shared page config
pages/ # One file per dashboard page (2–9)
data_loader.py # Loads BASF financials from the report workbooks
market.py # Read-only loader for the committed market snapshot
charts.py / bridge.py # Shared Plotly chart builders (incl. EBIT waterfall)
theme.py # Brand colors, CSS, segment palette (single source)
metrics.py / variance.py # KPI and variance calculations
capital.py / cashflow.py # Capital-efficiency and cash-flow logic
simulation.py # Driver-based profitability model
data/ # Committed offline market snapshot (CSV + JSON)
scripts/ # One-time market-snapshot fetch script
basf anual reports/ # BASF report tables — source of the financial data
tests/ # pytest suite incl. golden-value checks
What this project demonstrates
- Controlling fundamentals — segment P&L, variance analysis, ROCE/CAPEX,
EBIT bridges and cash-flow build, applied to real published figures.
- Data engineering — parsing irregular Excel report layouts into clean,
tested DataFrames; deterministic offline data for reliable demos.
- Product sense — a focused, navigable BI tool rather than a wall of charts,
with a consistent visual system and instant interactions.
Data & disclaimer
Financial figures are sourced from BASF SE’s publicly published investor-relations
materials (annual reports / “Selected Tables”). Market data via Yahoo Finance
(yfinance). This is an independent, non-commercial portfolio project and is not
affiliated with or endorsed by BASF SE.
评论