Home / Projects
DA · BA-02In progress

Excel Analytics

Sales analytics built end-to-end in Excel used as a real analytics engine: Power Query for ETL, a Power Pivot star schema, a DAX measure library, an interactive dashboard, and what-if scenario analysis. From raw CSV to an executive-ready report.

Data sourceSample Superstore: 9,994 US order-line rows, 2015-2018, fetched from a public mirror with zero authentication.
ArchitectureRaw CSV → Power Query (M) ETL → Power Pivot star schema → DAX measure library → interactive dashboard + what-if scenarios
StorageSource CSV ingested via Power Query; the analytical model lives inside the workbook as an in-memory Power Pivot model.
Stack
Power QueryMPower PivotDAXExcelPython
StatusIn progress: automated layer built and formula-verified; Power Pivot/DAX/Tableau finishing pending a Windows session
Where this stands. The data pipeline, star schema, and a fully working Excel-native measure/dashboard/what-if layer are built and verified (40/40 formula cross-checks against the evidence file, see Results below). Power Pivot's DAX engine, real slicers, and Scenario Manager only exist inside Excel desktop (Windows/Mac); this was built on a Linux machine with no Excel installed, so that layer is a precise, spec'd pending step, not a placeholder. A Tableau Public dashboard is prepared as a second channel, also pending manual publish.

Context

Commercial teams live in Excel, yet most sales workbooks stop at a pivot table over a single flat sheet. This project treats Excel as a full analytics platform: a governed ETL layer, a dimensional data model, a reusable DAX measure library, and an interactive dashboard a decision-maker can actually explore.

Business Problem

Which product categories, regions, and sub-categories drive revenue and profit, and how is the business trending year over year?

Leadership needs a single, self-service view to read performance, spot outliers, and test scenarios before committing budget.

Architecture

Superstore CSV Power Query · M Power Pivot · star schema DAX measures Dashboard · slicers What-if scenarios

The model is a star schema built inside Excel: a central fact table surrounded by conformed dimensions, joined by explicit one-to-many relationships. A dedicated date dimension unlocks time intelligence. This is the line between a spreadsheet and a model.

TableTypeGrain / RoleKey
fact_order_itemsFactone row per order line itemorder_item_key
dim_dateDimensioncalendar for time intelligencedate_key
dim_productDimensionproduct, category, sub-categoryproduct_key
dim_customerDimensioncustomer, segmentcustomer_key
dim_locationDimensionship-to city / state / region (not folded into customer, since one customer ships to more than one location)location_key

Data Source

Methodology

The build follows CRISP-DM:

  1. Business Understanding: frame the revenue / margin / trend questions above.
  2. Data Understanding: profile the raw export: keys, nulls, duplicates, category consistency.
  3. Data Preparation: clean and shape (Python today, mirrored 1:1 in Power Query M for the pending Windows pass).
  4. Modeling: star schema plus a measure library (Excel-native formulas today, DAX text ready to paste).
  5. Evaluation: every KPI computed two independent ways and cross-checked; every workbook formula re-evaluated headless and matched against that same evidence file.
  6. Deployment: interactive dashboard and what-if model live today; Power Pivot/DAX/Tableau publish pending.

1. Power Query: ETL

Repeatable, refreshable ETL in M: type coercion, a Postal Code text-fix (Excel otherwise infers it as a number and silently drops leading zeros), text trims, and a documented dedup rule for the 32 inconsistent product names. Every step is written once as a decision in the Python build (which runs and is the source of every published number) and again as real M code (paste-ready, not yet executed, no Excel available to run it): a 1:1 port, not a rewrite.

2. Power Pivot: data model

The star schema shown under Architecture above, 5 tables, built today as native Excel Tables, ready for Add to Data Model once opened in real Excel. The relationships, a marked Date Table, and hidden FK columns are the exact remaining checklist for the Windows session.

3. DAX: measures

A reusable measure library instead of one-off cell formulas, covering revenue, gross margin, average ticket, and MoM / YoY growth (11 measures total):

Revenue        = SUM ( fact_order_items[sales] )
Profit         = SUM ( fact_order_items[profit] )
Orders         = DISTINCTCOUNT ( fact_order_items[order_id] )
Average Ticket = DIVIDE ( [Revenue], [Orders] )
Gross Margin % = DIVIDE ( [Profit], [Revenue] )

Revenue PY     = CALCULATE ( [Revenue], SAMEPERIODLASTYEAR ( dim_date[date] ) )
Revenue YoY %  = DIVIDE ( [Revenue] - [Revenue PY], [Revenue PY] )

Because no Power Pivot model can exist in this build environment, the workbook also carries a live, working equivalent in plain Excel formulas (SUMIFS/SUMPRODUCT against a denormalized table), so it calculates correctly today, not only after the DAX is pasted in. Both were cross-checked to agree.

4. Interactive dashboard

Region and Category dropdown filters (Excel data validation) drive live KPI cards today, using a wildcard-aware distinct-count formula for Orders, a functional stand-in for slicers. Category/region breakdown charts and a 48-month revenue trend chart sit alongside. Real slicers and a timeline, connected to PivotCharts built off the DAX measures, are part of the pending Power Pivot pass.

5. What-if / scenario analysis

A 3-lever sensitivity model (% of deep-discount (>40%) lines "fixed", commission %, cost inflation %) comparing Base / Optimistic / Conservative / Custom scenarios. The discount-fix lever isn't an arbitrary slider: it's grounded in the measured relationship between discount depth and profit in this exact dataset. Real Scenario Manager cases, mirroring these same 3 named scenarios, are part of the pending Windows pass.

AI assist

The executive summary is AI-drafted from the validated measures and findings, explicitly marked pending the analyst's review, correction, and sign-off before it ships. Every number in the draft traces to the evidence file; the AI drafted prose and framing, not numbers. AI assists, human validates: the review step is part of the pending handoff, not skipped.

Challenges

These are the problems the build had to solve, named so the finished project can be judged on how it handled them.

Results

Automated layer verified; workbook screenshots pending. Every number below is real, from the evidence file (docs/evidence/figures.json), computed two independent ways and cross-checked. The interactive dashboard and what-if model are built and live in workbook/sales_analytics.xlsx today; screenshots go up once the Power Pivot/DAX/Tableau session happens.

Recommendations from the analysis: cap discounts near 20% by default; re-examine Furniture's pricing/cost structure, not its volume; audit Binders' and Machines' discount practices specifically; and prioritize root-causing Central's underperformance before allocating it more spend. Full detail in the repository README.

Tech Stack

LayerTool
ETL / cleaningPower Query (M), spec'd, mirrored in Python for headless reproducibility
Source dataCSV (Sample Superstore, public mirror, no auth)
Data modelPower Pivot (star schema), pending; native Excel Tables today
MeasuresDAX, spec'd; Excel-native formula equivalent live today
DashboardExcel, dropdown filters, native charts today; slicers/timeline pending
Scenario analysisData-grounded 3-lever sensitivity model, live; Scenario Manager pending
VerificationHeadless Excel-formula evaluator, cross-checked against the evidence file
NarrativeLLM-drafted, human-validated (pending)
← Previous
Customer Churn: Revenue at Risk