I'll build a comprehensive Power BI–style Billing Tracker dashboard. Let me start by exploring the project structure.
Tailwind v4 with a single-file build. Let me install the charting library.
Now the stylesheet with dark-mode variant and design tokens.
Now the core data engine — a deterministic, richly-seasonal synthetic dataset.
Now the analytics engine: filtering, aggregation, variance bridge, and forecasting.
Now the shared UI primitives (cards, multi-selects, sparkline, theme context).
Now the chart library — trend, forecast, waterfall bridge, donuts and team bars.
Now the KPI summary cards with trend indicators and sparklines.
Now the sortable, filterable data table with three drill-down modes and CSV export.
Now the live filter bar with date-range presets and segment selectors.
Now the main dashboard application that wires everything together.
Now let me update the page title and build.
Build succeeded. Let me polish a few details — dynamic donut tooltips, conditional axis, and an empty state.
Let me fix a subtle boundary issue where weeks spanning month ends could be mis-filtered.
A 12-month comparison needs 12 prior months of history — let me extend the dataset and handle empty comparisons.
Let me refine the data model so plan vs. actual diverge realistically (creating genuine attainment gaps).
Let me improve the waterfall chart's scale so the deltas are actually visible.
One last fix — chart tooltips near card edges shouldn't be clipped.
I built a full Billing Tracker · Organisation Control Tower — a Power BI–style executive dashboard.
What's in it
Data engine (src/lib/data.ts) — a deterministic seeded generator producing ~11,000 weekly timesheet rows: 86 employees across 7 teams (each with a named manager, role, grade, site, contract type, bill rate), 30 months of history with real calendar working days, public holidays, leave seasonality (December/May spikes), team-specific growth and decline trends, and a deliberate current-month shock (ERP & Enterprise Apps loses a client, Digital Engineering softens, Data & AI over-delivers) so the "why is this month off?" story is genuinely there in the numbers.
Critically, plan and actual are generated from two separate demand curves — the committed plan is locked before the month, actuals reflect what landed — so attainment gaps are real, not arithmetic artifacts.
Analytics (src/lib/analytics.ts)
- Live scoping: date range → employee eligibility → derived billing status → status filter → re-aggregation
- Previous-equivalent-period comparison for every KPI
- Exact variance bridge:
billable = capacity − holiday − leave − bench − internal − training − pre-sales − admin, so the waterfall reconciles to the hour
- Forecast: weighted linear regression on hours-per-working-day (recent months weighted higher), blended with a 3-month anchor, trend-damped over the horizon, with a residual-based confidence band — then denormalised by next month's actual working-day count
- Auto-generated executive insights ranked by hour impact
The dashboard
- 4 hero KPI cards (billable hours, attainment, revenue, utilisation) with sparklines, trend deltas, and progress-to-target, plus a 6-up strip (non-billable, bench, leave+holiday, attendance, revenue at risk, headcount)
- Executive briefing — plain-English findings with severity coding, naming the specific teams, managers and people to address
- Trend + forecast composed chart (planned bars, actual bars, utilisation line, dashed forecast with shaded confidence band), toggleable Hours ↔ Revenue
- Variance bridge waterfall with a focused Y-scale so small drivers stay visible
- Capacity-mix donut, billing-status donut, team league bars (attainment / utilisation / revenue) with a "Plan" reference line, leakage stacked-bar + utilisation overlay, and an end-to-end reconciling hours ledger
- Data explorer with three modes (Employees / Teams / Leave register), every column sortable, local search, status quick-chips, page sizing, and CSV export
- Filters: 5 date presets + custom range, plus Team / Status / Site / Contract multi-selects and global search — all recompute every visual instantly
- Animated dark-mode toggle persisted to localStorage, and a responsive layout that reflows cleanly from ultrawide down to mobile.
Files built: src/index.css, src/lib/data.ts, src/lib/analytics.ts, src/components/ui.tsx, src/components/Charts.tsx, src/components/KpiCards.tsx, src/components/DataTable.tsx, src/components/FilterBar.tsx, src/App.tsx, index.html