Week 12: Capstone — End-to-End Analytics Project

No new concepts this week — this is where the previous eleven come together. You'll clean and shape a raw, messy dataset in Excel, load it and answer a set of real business questions in SQL, then model it properly and publish an interactive Power BI dashboard on top. The finished project is a portfolio piece: something you built end to end, across all three tools, and can defend every decision behind.

Module 12 of 12 Week 12 of 12 ~5–6 Hours Capstone Project

By the end of this week, you'll be able to

  • Clean and combine several messy raw exports into one reliable dataset with Power Query
  • Answer a set of real business questions directly in SQL, using views and window functions
  • Publish a portfolio-ready Power BI dashboard, modeled and measured correctly

1. The Project Brief

Build a Regional Retail Performance Dashboard. You're handed twelve monthly CSV exports of order data across several regions and stores — messy, inconsistent, and never meant to be analyzed directly. It's small enough to finish in one sitting, but touches every module in this course: Power Query cleanup, SQL joins/aggregation/window functions, and a modeled, measured, published Power BI report.

The finished project needs to answer:

  • Which regions and stores are growing, and which are declining, quarter over quarter?
  • Which product categories drive the most revenue, and how has that mix shifted over the year?
  • Who are the top-performing stores, ranked, with a visible trend line and the ability to drill into any one store's detail?

2. Phase 1: Clean & Shape in Excel

The raw monthly exports (Week 4 territory) share a structure but not a clean one: inconsistent date formats, a stray subtotal row at the bottom of some files, a store id column that's sometimes text and sometimes a number depending on the month it was exported.

Power Query steps — applied once, repeatable across all 12 files
1. Get Data → From Folder, pointing at the folder holding all 12 monthly CSVs
2. Combine & Transform -- Power Query appends every file automatically
3. Remove any row where OrderID is blank (catches stray subtotal rows)
4. Change StoreID's data type to Text explicitly, for every file consistently
5. Parse OrderDate with a fixed format, correcting any month that used
   a different date format than the rest
6. Remove Duplicates on OrderID, in case a month's export overlapped another

From Folder is Week 4's Append Queries idea taken one step further — instead of manually appending 12 separately-imported queries, it combines every file in a folder in one pass, and re-runs automatically if a 13th file is ever dropped in later. Export the cleaned result as one flat file — that's what SQL loads in Phase 2.

3. Phase 2: Query in SQL

With clean data loaded into orders (plus reference stores, regions and products tables), answer the brief's questions directly:

sql — quarter-over-quarter growth by region
CREATE OR REPLACE VIEW region_quarterly_totals AS
SELECT r.region_name,
       DATE_TRUNC('quarter', o.order_date) AS quarter,
       SUM(o.amount) AS total_amount
FROM orders o
JOIN stores s  ON s.store_id  = o.store_id
JOIN regions r ON r.region_id = s.region_id
GROUP BY r.region_name, DATE_TRUNC('quarter', o.order_date);

SELECT region_name, quarter, total_amount,
       LAG(total_amount) OVER (PARTITION BY region_name ORDER BY quarter) AS prev_quarter,
       ROUND(
         100.0 * (total_amount - LAG(total_amount) OVER (PARTITION BY region_name ORDER BY quarter))
         / NULLIF(LAG(total_amount) OVER (PARTITION BY region_name ORDER BY quarter), 0), 1
       ) AS qoq_growth_pct
FROM region_quarterly_totals
ORDER BY region_name, quarter;

This is Week 8's view pattern plus Week 7's LAG window function, applied directly to the brief's first question — the same shape answers the second question by swapping region_name for category, and the third by ranking with RANK() over total revenue per store instead of computing growth.

4. Phase 3: Model & Visualize in Power BI

Connect Power BI to the SQL database (or the views built in Phase 2 directly) and build the star schema from Week 9: Orders as the fact table, Stores, Regions, Products and a generated DateTable as dimensions, related with one-to-many relationships.

dax — the measures the brief actually needs
Total Revenue = SUM(Orders[amount])

Revenue QoQ % Change =
VAR CurrentQuarter = [Total Revenue]
VAR PrevQuarter =
    CALCULATE([Total Revenue], DATEADD(DateTable[Date], -1, QUARTER))
RETURN DIVIDE(CurrentQuarter - PrevQuarter, PrevQuarter)

Store Rank = RANKX(ALL(Stores[store_name]), [Total Revenue], , DESC)

Build a summary page (regional trend line, category revenue mix as a stacked bar, a top-stores table sorted by Store Rank) and a store-detail drill-through page, exactly as practiced in Week 11 — then publish to Power BI Service.

5. Capstone Project

Capstone

Ship the full Regional Retail Performance Dashboard

Everything from Sections 1–4, built out completely and published.

Requirements:

  1. Combine and clean at least 3 months of sample order data (real or self-generated) into one reliable table using Power Query's From Folder + Append pattern.
  2. In SQL, build the region_quarterly_totals-style view from Section 3, plus one you design yourself answering the category-mix question, using at least one window function in each.
  3. Build the full star-schema model in Power BI: fact table, at least 3 dimension tables, and a proper marked date table.
  4. Write at least 5 DAX measures, including one time-intelligence measure and one RANKX-based ranking measure.
  5. Publish a 2-page report (summary + drill-through detail) to Power BI Service, with at least one slicer and correctly configured visual interactions.
  6. Write a short README explaining, in your own words, one cleaning decision from Phase 1, one query design decision from Phase 2, and one modeling decision from Phase 3.
What "done" looks like

A published Power BI report you can hand a link to right now, a README that explains real decisions rather than just listing steps, and numbers that trace back to a specific SQL view or DAX measure you can point to — not a report assembled by clicking around until something looked right. That combination is what makes this a portfolio piece rather than a tutorial exercise.

6. Course Recap

Twelve weeks, three tools, one connected skill set:

  • Weeks 1, 3–4 — Excel formulas, lookups, PivotTables, and Power Query/Power Pivot at scale.
  • Weeks 2, 5–8 — SQL from a first SELECT through joins, aggregation, window functions, views and query optimization.
  • Week 9 — bringing Excel and SQL data into Power BI and modeling it as a proper star schema.
  • Week 10 — DAX measures, filter context, and time intelligence.
  • Week 11 — dashboard design, interactivity, and publishing with refresh and row-level security.
  • Week 12 — all of it, together, in one project you built and can explain.

That's the full Excel, SQL & Power BI path. From here, the Python course pairs directly with what you've built here — automating the exact cleaning and analysis steps from Phases 1–2 with pandas instead of clicking through Power Query and writing every query by hand — and the LLM & ML course is the natural next stop once "describe what happened" starts turning into "predict what happens next."