fx Capstone

Capstone: 50k-row retail dataset — Power Query model + 4 pivots + 3 charts + insight summary

⏱ 45 min

What you'll learn

  • The data (resources/capstone)
  • Step 1 — Power Query (Module 3) · ~12 min
  • Step 2 — Data model and measures (Module 4) · ~10 min

Concept

"How did FY2025-26 go compared with last year and with target — and where should we focus next year?"

Your deliverable: one workbook with a refreshable data model, 4 pivots, 3 charts, a dashboard with slicers, and a half-page insight summary.

1. The data (resources/capstone)

File Contents
data/sales_2024-04.csv … sales_2026-03.csv 24 monthly files, 50,000 order lines: OrderID, OrderDate (dd-mm-yyyy text), StoreID, ProductID, Qty, UnitPrice, Discount
stores.csv StoreID, StoreName, City, Region (8 rows)
products.csv ProductID, Product, Category, UnitPrice, UnitCost (12 rows)
targets.csv Month, Region, Target — FY2025-26 monthly revenue targets (48 rows)

Deliberate problems (as in real exports): ~1,000 StoreIDs with a trailing space, ~240 blank Discounts, dates as Indian text.

2. Step 1 — Power Query (Module 3) · ~12 min

  1. Put the folder path in a named cell FolderPath; create pFolder (Module 3 Lesson 7).
  2. stg_Sales: From Folder → filter .csv → Combine. Remove Other Columns (the 7 fields). Trim StoreID. Types with locale en-IN (OrderDate date; Qty whole; UnitPrice, Discount decimal). Replace null Discount → 0. Add Revenue = [Qty] * [UnitPrice] * (1 - [Discount]). Load: Connection Only.
  3. dim_Stores, dim_Products, fact_Targets from the three CSVs (trim, types; Targets Month as date).
  4. fact_Sales = Reference of stg_Sales → Add to Data Model.
  5. chk_UnknownStores: Left Anti merge Sales → Stores. Must return 0 rows.

✅ Check: fact_Sales = 50,000 rows; StoreID has 8 distinct values.

3. Step 2 — Data model and measures (Module 4) · ~10 min

  • Relationships: fact_Sales → dim_Stores (StoreID), fact_Sales → dim_Products (ProductID), fact_Sales → Calendar (OrderDate → Date).
  • Calendar with FY and FY month number; mark as Date Table.
  • Targets: relate fact_Targets[Region] via a small dim_Region table (North/South/East/West) and fact_Targets[Month] → Calendar[Date] — or keep targets in a separate pivot with SUMIFS if you prefer simplicity.
  • Measures:
Total Revenue := SUM(fact_Sales[Revenue])
Total Cost    := SUMX(fact_Sales, fact_Sales[Qty] * RELATED(dim_Products[UnitCost]))
Profit        := [Total Revenue] - [Total Cost]
Margin %      := DIVIDE([Profit], [Total Revenue])
Orders        := DISTINCTCOUNT(fact_Sales[OrderID])
Avg Order Value := DIVIDE([Total Revenue], [Orders])
Revenue LY    := CALCULATE([Total Revenue], SAMEPERIODLASTYEAR('Calendar'[Date]))
YoY %         := DIVIDE([Total Revenue] - [Revenue LY], [Revenue LY])
Revenue YTD   := TOTALYTD([Total Revenue], 'Calendar'[Date], "3/31")
Target        := SUM(fact_Targets[Target])
Achievement % := DIVIDE([Total Revenue], [Target])

(With the dim_Region approach, regional pivots must use dim_Region[Region] so both sales and targets filter. Relate dim_Stores[Region] → dim_Region too.)

The sample has 50,000 unique OrderIDs, one line per order, so COUNTROWS and DISTINCTCOUNT agree here. In real multi-line orders use DISTINCTCOUNT for Orders and AOV.

4. Step 3 — Four pivots (Module 2 + 4) · ~8 min

# Pivot Rows / Columns Values
P1 Region performance Region Total Revenue, Revenue LY, YoY %, share (% of column total) — filter FY2025-26
P2 Category profitability Category Total Revenue, Profit, Margin % — FY2025-26
P3 Monthly trend FY Month (Apr→Mar), Columns: FY Total Revenue, Revenue YTD
P4 Target tracker Region × Month (FY2025-26) Target, Total Revenue, Achievement % + RAG (Module 7)

Use dim_Region[Region] for a Region slicer connected to all four pivots. Connect Category only to P1, P2 and P3: targets exist at Region × Month grain, so P4 must compare all-category sales with all-category targets. Keep Store/Product slicers away from P4 too. Connect the FY slicer to P1, P2 and P4; leave P3 disconnected so its two-year comparison retains both FYs. Use whole months, not individual dates, for P4 because targets are stored on month-start dates. Label these filter scopes on the dashboard.

This design follows the principle of matching comparisons to the target table’s grain. Do not allocate targets to categories without an explicit business rule.

5. Step 4 — Three charts (Module 5) · ~7 min

  1. Line: monthly revenue FY2025-26 vs FY2024-25 (from P3). Title states the seasonal message.
  2. Sorted bar or combo: revenue by category with Margin % labels — shows the volume vs margin trade-off.
  3. Waterfall: FY2024-25 revenue → +East +North +South +West → FY2025-26 revenue (build from P1 values; set first/last as totals).

Apply the Module 5 Lesson 6 clean-up: zero-based bars, direct labels, one highlight colour, conclusion titles.

6. Step 5 — Insight summary · ~8 min

Half a page, 5–7 bullets, each with a number, a so-what and (where possible) an action. Use this structure:

  1. Headline: overall growth and target result.
  2. Where growth came from (regions, orders vs order value).
  3. Where we're weak (region/store vs target).
  4. Mix and margin (categories).
  5. Seasonality and what it means for planning.
  6. Recommendations (2–3, specific).
  7. Data notes (cleaning done, assumptions).

7. Answer key — check your numbers

Check Expected
Rows loaded 50,000 (24 files)
FY2024-25 revenue / profit / margin 26,56,58,820 / 4,45,72,110 / 16.8%
FY2025-26 revenue / profit / margin 29,49,96,410 / 4,88,02,160 / 16.5%
Orders FY24-25 → FY25-26 23,691 → 26,309
Revenue YoY +11.0%
YoY by region East +11.4%, North +11.9%, South +15.1%, West +6.3%
Region share FY25-26 North 32.0%, West 25.3%, South 24.2%, East 18.5%
Category revenue & margin FY25-26 Electronics 21.35 cr, 12.3% · Furniture 4.13 cr, 25.6% · Kitchen 3.58 cr, 28.5% · Home Decor 0.44 cr, 39.6%
Oct + Nov share of FY25-26 revenue / margin 24.6% / 10.9% (rest of year 18.4%)
Top / bottom store Karol Bagh 4,93,63,475 / Salt Lake 2,60,91,672
Target FY25-26 / achievement 30,55,00,000 / 96.6%
Achievement by region East 96.8%, North 97.3%, South 100.1%, West 92.4%
RAG, 48 region-months 19 Green, 13 Amber, 16 Red
Avg order value ₹11,213 both years (flat)

Small differences (₹1–2) from rounding are fine.

8. Example insight summary

  • Revenue grew 11.0% to ₹29.50 cr, but we reached only 96.6% of target (₹1.05 cr short). The target assumed 15% growth.
  • Growth came entirely from more orders (+11.1%, 23,691 → 26,309); average order value stayed flat at ₹11,213. → Test bundles/upselling to lift basket size.
  • West is the problem region: slowest growth (+6.3%) and furthest from target (92.4%, ₹61 lakh short). South is the only region above target (+15.1% growth). → Review West's store-level drivers (footfall, conversion, assortment) before setting next year's target.
  • Electronics is 72% of revenue but only 54% of profit (margin 12.3%), while Kitchen (28.5%) and Furniture (25.6%) earn twice the margin. → Grow Kitchen/Furniture share; watch Electronics discounting.
  • Diwali months (Oct–Nov) brought 24.6% of the year's revenue, but at a 10.9% margin vs 18.4% in the other ten months, because festive discounts are deeper. → Plan stock and staffing for Oct–Nov from August; use YoY, not MoM, in monthly reviews.
  • Data notes: 1,024 store codes trimmed, 239 blank discounts treated as 0, dates parsed as dd-mm-yyyy (en-IN). Targets = last year × 1.15.

9. Self-review rubric

Area Excellent
Power Query parameter path, locale types, no hard-coded columns that break, check query = 0 rows, steps renamed
Model star schema, marked Calendar, measures (not calculated columns) for ratios
Pivots correct numbers (answer key), clean layout, connected slicers
Charts right chart family, honest axes, conclusion titles, no chartjunk
Insights every bullet has a number, a so-what and an action; ≤ half a page
Refresh test add a dummy April 2026 CSV → Refresh All → everything updates without errors

Common mistakes

Building pivots on the raw CSV import instead of the model. Margin % as a calculated column. Comparing October with September (MoM) in a seasonal business. Insight bullets that only restate numbers without a recommendation.

Exercises

mediumBuild the model, four pivots and three charts using the supplied data. Apply the slicer connections in section 4, reconcile all section 7 checks, and write five evidence-based insights. In a copy, add a test April 2026 file, extend Calendar if needed, refresh, then remove it and confirm the baseline returns to 50,000 rows. Keep targets at their documented Region × Month grain.
Reconcile 24 CSVs and 50000 unique orders; trim 1024 StoreIDs and fill 239 null discounts. FY2024-25 revenue/profit 265658820/44572110; FY2025-26 294996410/48802160; target 305500000 (96.5618%). Validate 4 pivots, 3 charts and the Region/Month-only target comparison. Keep both FYs in the trend. West has lowest growth/achievement; Electronics dominates sales but has lower margin. Use the bundled reference tables to verify and label evidence versus hypotheses in five actionable insights.

Quiz

Which region grew slowest and missed target most?
West: +6.3% YoY, 92.4% of target
Did growth come from more orders or bigger orders?
More orders — AOV was flat
Why is Electronics' share of profit lower than its share of revenue?
Lowest margin, 12.3%
Capstone: 50k-row retail dataset — Power Query model + 4 pivots + 3 charts + insight summary · Analysis & Visualization | ExcelWalaa