Skip to content

📘 Buổi 19: Capstone — Analysis & Dashboard — Chạy sprint phân tích

Giai đoạn quan trọng nhất: biến raw data thành insight + dashboard.

🎯 Mục tiêu buổi học

Sau buổi này, học viên sẽ:

  1. Hoàn thành data cleaning & EDA cho capstone dataset
  2. Phân tích chuyên sâu: statistical test, modeling (nếu phù hợp)
  3. Xây dashboard tương tác trên Power BI / Tableau
  4. Viết draft executive summary

📋 Tổng quan

Buổi 18 — bạn đã chọn đề bài, thu thập data, và hoàn thành data audit. Raw data đã nằm sẵn trong folder. Nhưng raw data CHƯA phải insight. Khách hàng hoặc stakeholder không đọc CSV file — họ đọc dashboard và summary.

Buổi 19 là giai đoạn execution — biến raw data thành analysis notebook, dashboard tương tác, và executive summary. Đây là sprint quan trọng nhất của capstone: 80% giá trị project nằm ở đây.

Theo Gartner (2025), 65% analytics projects fail ở giai đoạn "analysis to insight" — không phải vì thiếu data, mà vì thiếu focus, process, và quality control. Sprint methodology giúp bạn tránh 3 lỗi phổ biến: scope creep, analysis paralysis, và "dashboard dump" (tạo 20 charts mà không chart nào trả lời business question).

mermaid
flowchart LR
    A["📦 Buổi 18<br/>Data Collection<br/>& Data Audit"] --> B["🔬 Buổi 19<br/>Analysis Sprint<br/>& Dashboard v1"]
    B --> C["🎤 Buổi 20<br/>Presentation<br/>& Portfolio"]
    style B fill:#e8f5e9,stroke:#4caf50,stroke-width:3px

Capstone Sprint Overview

mermaid
flowchart TD
    A["🔍 Sprint Planning<br/>Review data audit, define 5 questions"] --> B["🧹 Data Cleaning<br/>Handle missing, outliers, types"]
    B --> C["📊 EDA Notebook<br/>Distributions, correlations, segments"]
    C --> D["🧪 Statistical Analysis<br/>Tests, modeling (if applicable)"]
    D --> E["📐 Dashboard Mockup<br/>Layout, pages, KPI placement"]
    E --> F["📊 Dashboard Build<br/>Import data, measures, viz"]
    F --> G["👥 Peer Review<br/>Feedback, iterate"]
    G --> H["📝 Executive Summary<br/>5 findings, What→So What→Now What"]

💡 Sprint mindset

Sprint không phải "ngồi phân tích thoải mái" — sprint là time-boxed, goal-oriented, deliverable-focused. Mỗi block thời gian có output cụ thể. Nếu 2 giờ mà chưa xong EDA → scope lại, focus vào top 5 variables thay vì 20.


📌 Phần 1: Sprint Phân Tích — Từ Raw Data đến Findings

Sprint Planning: Review Data Audit

Trước khi code bất kỳ dòng nào, mở lại Data Audit từ Buổi 18 và trả lời:

Câu hỏiMục đích
Dataset có bao nhiêu rows × columns?Xác định scope
Columns nào là key metrics?Focus EDA vào những gì quan trọng
Missing values ở đâu? Bao nhiêu %?Plan cleaning strategy
Data types đã đúng chưa?Tránh lỗi khi analysis
5 business questions cần answer?Hướng dẫn toàn bộ analysis

5 Business Questions Framework

Mỗi capstone project PHẢI answer 5 business questions. Đây là compass cho toàn bộ analysis — không có câu hỏi = không có hướng.

┌──────────────────────────────────────────────────────┐
│  5 BUSINESS QUESTIONS — TEMPLATE                      │
│                                                       │
│  Q1: Descriptive — "Tình hình hiện tại thế nào?"      │
│  Q2: Diagnostic — "Tại sao chỉ số X thay đổi?"       │
│  Q3: Comparative — "Segment A vs B khác nhau gì?"     │
│  Q4: Predictive — "Trend sẽ đi đâu?"                 │
│  Q5: Prescriptive — "Nên làm gì tiếp theo?"          │
└──────────────────────────────────────────────────────┘

Ví dụ — E-commerce Capstone:

#Business QuestionAnalysis Method
Q1Doanh thu 12 tháng qua trend thế nào?Time series plot, MoM growth
Q2Tại sao Q3 revenue giảm 15%?Segment breakdown, cohort analysis
Q3Khách hàng mới vs returning khác nhau gì về AOV?Group comparison, t-test
Q4Revenue Q1 năm sau forecast bao nhiêu?Moving average, linear trend
Q5Nên focus product nào để tăng margin?Pareto analysis, contribution margin

Data Cleaning Checklist

Mở Jupyter Notebook, tạo section ## Data Cleaning và chạy checklist:

python
# ============================================
# DATA CLEANING CHECKLIST
# ============================================

import pandas as pd
import numpy as np

# Load data
df = pd.read_csv('capstone_data.csv')

# 1. Shape & Overview
print(f"Shape: {df.shape}")
print(f"\nData Types:\n{df.dtypes}")
print(f"\nFirst 5 rows:\n{df.head()}")

# 2. Missing Values
missing = df.isnull().sum()
missing_pct = (missing / len(df) * 100).round(1)
missing_report = pd.DataFrame({
    'Missing Count': missing,
    'Missing %': missing_pct
}).query('`Missing Count` > 0').sort_values('Missing %', ascending=False)
print(f"\n🔍 MISSING VALUES:\n{missing_report}")

# 3. Duplicates
dupes = df.duplicated().sum()
print(f"\n🔁 Duplicates: {dupes} ({dupes/len(df)*100:.1f}%)")

# 4. Data Types — auto-fix
# Dates
date_cols = ['order_date', 'signup_date']  # adjust per project
for col in date_cols:
    if col in df.columns:
        df[col] = pd.to_datetime(df[col], errors='coerce')

# 5. Outliers — IQR method
numeric_cols = df.select_dtypes(include=[np.number]).columns
for col in numeric_cols:
    Q1 = df[col].quantile(0.25)
    Q3 = df[col].quantile(0.75)
    IQR = Q3 - Q1
    outliers = ((df[col] < Q1 - 1.5*IQR) | (df[col] > Q3 + 1.5*IQR)).sum()
    if outliers > 0:
        print(f"  ⚠️ {col}: {outliers} outliers ({outliers/len(df)*100:.1f}%)")

print("\n✅ Cleaning checklist complete!")

Missing Value Strategy

% MissingStrategyCode
< 5%Drop rowsdf.dropna(subset=['col'])
5-30%Impute (median for numeric, mode for categorical)df['col'].fillna(df['col'].median())
30-50%Impute + create flag columndf['col_missing'] = df['col'].isnull().astype(int)
> 50%Drop column (trừ khi critical)df.drop(columns=['col'])

EDA Notebook Structure

📓 CAPSTONE EDA NOTEBOOK
━━━━━━━━━━━━━━━━━━━━━━━━
1. Setup & Import Data
2. Data Cleaning (checklist above)
3. Univariate Analysis
   - Distribution of each key variable
   - Summary statistics
4. Bivariate Analysis
   - Correlation matrix
   - Key variable vs target
5. Segment Analysis
   - Group comparisons
   - Time-based patterns
6. Answer Business Questions (Q1-Q5)
7. Key Findings Summary

Univariate & Bivariate Analysis

python
# ============================================
# EDA — UNIVARIATE & BIVARIATE
# ============================================
import matplotlib.pyplot as plt
import seaborn as sns

# ----- Univariate: Distribution -----
fig, axes = plt.subplots(2, 3, figsize=(16, 10))
for idx, col in enumerate(numeric_cols[:6]):
    ax = axes[idx // 3, idx % 3]
    df[col].hist(bins=30, ax=ax, color='steelblue', edgecolor='white')
    ax.set_title(col)
    ax.axvline(df[col].median(), color='red', linestyle='--', label='Median')
    ax.legend()
plt.tight_layout()
plt.suptitle('Distribution of Key Variables', y=1.02, fontsize=14)
plt.show()

# ----- Bivariate: Correlation Matrix -----
corr = df[numeric_cols].corr()
plt.figure(figsize=(12, 8))
sns.heatmap(corr, annot=True, cmap='RdBu_r', center=0, fmt='.2f',
            square=True, linewidths=0.5)
plt.title('Correlation Matrix')
plt.show()

# ----- Top Correlations -----
corr_pairs = corr.unstack().sort_values(ascending=False)
corr_pairs = corr_pairs[corr_pairs < 1]  # remove self-correlation
print("🔝 Top 10 Correlations:")
print(corr_pairs.head(10))

Statistical Analysis (nếu phù hợp)

Business QuestionStatistical TestKhi nào dùng
Segment A vs B khác nhau?Independent t-test / Mann-Whitney USo sánh 2 groups
Metric trước vs sau campaign?Paired t-test / WilcoxonBefore-after comparison
Category có ảnh hưởng metric?ANOVA / Kruskal-WallisSo sánh 3+ groups
2 variables có correlation?Pearson / SpearmanLinear / monotonic relationship
Predict continuous outcome?Linear RegressionRevenue, LTV forecast
Predict binary outcome?Logistic RegressionChurn, conversion
python
# ============================================
# STATISTICAL ANALYSIS — EXAMPLE
# ============================================
from scipy import stats

# T-test: Compare AOV between new vs returning customers
new_aov = df[df['customer_type'] == 'New']['order_value']
ret_aov = df[df['customer_type'] == 'Returning']['order_value']

t_stat, p_value = stats.ttest_ind(new_aov, ret_aov)

print(f"📊 T-Test: New vs Returning AOV")
print(f"  New AOV Mean: {new_aov.mean():,.0f} VND")
print(f"  Returning AOV Mean: {ret_aov.mean():,.0f} VND")
print(f"  t-statistic: {t_stat:.3f}")
print(f"  p-value: {p_value:.4f}")
print(f"  Significant? {'✅ Yes (p < 0.05)' if p_value < 0.05 else '❌ No'}")

Document Findings

Sau mỗi analysis section, viết Finding Box:

┌──────────────────────────────────────────────────────┐
│  📋 FINDING #1                                        │
│                                                       │
│  WHAT: Revenue giảm 15% trong Q3 2025                │
│  WHY: Segment "Monthly Premium" churn tăng 40%       │
│  SO WHAT: Mất ~200 triệu ARR nếu trend tiếp tục     │
│  NOW WHAT: Launch retention campaign cho Monthly      │
│            subscribers < 6 tháng tenure               │
└──────────────────────────────────────────────────────┘

📌 Phần 2: Dashboard Development — Từ Mockup đến Dashboard v1

Dashboard Design Principles

Trước khi mở Power BI / Tableau, sketch trên giấy hoặc whiteboard trước.

Nguyên tắcMô tảLỗi thường gặp
1. Purpose firstMỗi page trả lời 1-2 business questionsDump 15 charts không ai biết đọc từ đâu
2. HierarchyKPI lớn ở trên, chi tiết ở dướiMọi thứ cùng size → không biết focus vào đâu
3. FlowLeft → Right, Top → BottomCharts random không có logic flow
4. ColorMax 3-5 colors, consistent paletteRainbow dashboard — mỗi chart 1 palette
5. White spaceĐể thở — không nhồi nhétMỗi pixel đều có chart → overwhelm

Dashboard Layout Mockup

┌──────────────────────────────────────────────────────────────┐
│  PAGE 1: EXECUTIVE OVERVIEW                                   │
│                                                               │
│  ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐                        │
│  │ KPI 1│ │ KPI 2│ │ KPI 3│ │ KPI 4│  ← Big Numbers         │
│  │ Rev  │ │ Users│ │ Conv │ │ Churn│                         │
│  └──────┘ └──────┘ └──────┘ └──────┘                         │
│                                                               │
│  ┌────────────────────────┐ ┌──────────────┐                  │
│  │                        │ │              │                  │
│  │    Revenue Trend       │ │  Revenue by  │                  │
│  │    (Line Chart)        │ │  Segment     │                  │
│  │    12 months           │ │  (Donut)     │                  │
│  └────────────────────────┘ └──────────────┘                  │
│                                                               │
│  ┌────────────────────────────────────────┐                   │
│  │  Top Products / Channels Table          │                  │
│  └────────────────────────────────────────┘                   │
└──────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────┐
│  PAGE 2: DEEP DIVE — [Segment/Product/Customer]              │
│                                                               │
│  ┌──────────┐  ┌──────────────────────────┐                  │
│  │ Filters  │  │                          │                  │
│  │ - Date   │  │  Comparison Chart        │                  │
│  │ - Region │  │  (Bar / Grouped Bar)     │                  │
│  │ - Segment│  │                          │                  │
│  └──────────┘  └──────────────────────────┘                  │
│                                                               │
│  ┌──────────────────┐ ┌──────────────────┐                   │
│  │  Scatter Plot    │ │  Heatmap /       │                   │
│  │  (Correlation)   │ │  Cohort Table    │                   │
│  └──────────────────┘ └──────────────────┘                   │
└──────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────┐
│  PAGE 3: INSIGHTS & RECOMMENDATIONS                          │
│                                                               │
│  ┌────────────────────────────────────────┐                   │
│  │  Key Finding + Annotation Visual       │                  │
│  │  (Annotated chart with callouts)       │                  │
│  └────────────────────────────────────────┘                   │
│                                                               │
│  ┌────────────────────────────────────────┐                   │
│  │  Summary Table: What → So What →       │                  │
│  │  Now What for top 5 findings           │                  │
│  └────────────────────────────────────────┘                   │
└──────────────────────────────────────────────────────────────┘

Dashboard Build Process

mermaid
flowchart TD
    A["1️⃣ Import Cleaned Data<br/>CSV/Excel → Power BI / Tableau"] --> B["2️⃣ Data Model<br/>Relationships, calculated columns"]
    B --> C["3️⃣ Create Measures<br/>KPI calculations, YoY, MoM"]
    C --> D["4️⃣ Page 1: Overview<br/>KPI cards + trend + breakdown"]
    D --> E["5️⃣ Page 2: Deep Dive<br/>Filters + comparisons + segments"]
    E --> F["6️⃣ Page 3: Insights<br/>Annotated charts + recommendations"]
    F --> G["7️⃣ Formatting<br/>Colors, titles, tooltips, mobile"]
    G --> H["8️⃣ Peer Review<br/>Get feedback, iterate"]

DAX/Calculated Fields — Common Measures

Power BI (DAX):

dax
// Revenue YoY Growth
Revenue YoY =
VAR CurrentYear = SUM(Sales[Revenue])
VAR PrevYear = CALCULATE(SUM(Sales[Revenue]), SAMEPERIODLASTYEAR(Calendar[Date]))
RETURN DIVIDE(CurrentYear - PrevYear, PrevYear, 0)

// Customer Count
Active Customers = DISTINCTCOUNT(Sales[CustomerID])

// Average Order Value
AOV = DIVIDE(SUM(Sales[Revenue]), COUNT(Sales[OrderID]), 0)

// MoM Growth
Revenue MoM =
VAR CurrentMonth = SUM(Sales[Revenue])
VAR PrevMonth = CALCULATE(SUM(Sales[Revenue]), DATEADD(Calendar[Date], -1, MONTH))
RETURN DIVIDE(CurrentMonth - PrevMonth, PrevMonth, 0)

Tableau (Calculated Fields):

// Revenue YoY Growth
(SUM([Revenue]) - LOOKUP(SUM([Revenue]), -12)) / ABS(LOOKUP(SUM([Revenue]), -12))

// Running Total
RUNNING_SUM(SUM([Revenue]))

// Customer Retention Rate
COUNTD(IF [Order Count] > 1 THEN [Customer ID] END) / COUNTD([Customer ID])

Dashboard QA Checklist (Quick)

Trước khi peer review, self-check:

✅ Mỗi chart có title rõ ràng (không phải "Chart 1")
✅ Axes có label + unit (VND, %, count)
✅ Number format consistent (1,234,567 hoặc 1.2M — chọn 1)
✅ Colors consistent across pages (cùng segment = cùng màu)
✅ Filters hoạt động đúng (cross-filter logic)
✅ KPI cards có comparison (vs previous period)
✅ Tooltips show useful detail
✅ No chart junk — remove gridlines, borders nếu không cần
✅ Dashboard title + date range rõ ràng
✅ Mobile view (nếu Tableau Public / Power BI Service)

Peer Review Process

mermaid
flowchart LR
    A["👤 Builder<br/>Present dashboard<br/>3 phút"] --> B["👥 Reviewers<br/>Ask questions<br/>+ feedback"]
    B --> C["📝 Capture Notes<br/>What works,<br/>What to improve"]
    C --> D["🔄 Iterate<br/>Fix top 3 issues<br/>in 15 phút"]

Peer Review Template:

Tiêu chíScore (1-5)Comment
Trả lời business question?
Data đúng & consistent?
Visual hierarchy rõ ràng?
Charts phù hợp?
Insight rõ ràng, actionable?
Overall impression

📌 Phần 3: Executive Summary Draft — Từ Findings đến Action

Executive Summary là gì?

Executive Summary — tài liệu 1-2 trang tóm tắt toàn bộ analysis cho stakeholders/management. Không phải technical report — mà là business impact story.

⚠️ Executive Summary ≠ Report

Report = chi tiết, technical, data-heavy, 10+ trang. Executive Summary = tóm tắt, business-focused, action-oriented, 1-2 trang. CEO đọc Summary. Analyst team đọc Report.

What → So What → Now What Framework

Mỗi finding viết theo 3 lớp:

LayerCâu hỏiVí dụ
WHATDữ liệu nói gì?Revenue Q3 giảm 15% YoY
SO WHATTại sao quan trọng?Nếu trend tiếp tục → mất 800 triệu ARR
NOW WHATNên làm gì?Launch win-back campaign cho churned Premium users

Executive Summary Template

┌──────────────────────────────────────────────────────────────┐
│  📝 EXECUTIVE SUMMARY — [Project Title]                       │
│  Author: [Your Name] | Date: [Date] | Dataset: [Period]      │
│                                                               │
│  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   │
│  🎯 OBJECTIVE                                                 │
│  [1-2 sentences: bài toán gì, data gì,                       │
│   business context]                                           │
│                                                               │
│  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   │
│  📊 KEY FINDINGS                                              │
│                                                               │
│  1. [WHAT] → [SO WHAT] → [NOW WHAT]                          │
│  2. [WHAT] → [SO WHAT] → [NOW WHAT]                          │
│  3. [WHAT] → [SO WHAT] → [NOW WHAT]                          │
│  4. [WHAT] → [SO WHAT] → [NOW WHAT]                          │
│  5. [WHAT] → [SO WHAT] → [NOW WHAT]                          │
│                                                               │
│  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   │
│  💡 TOP 3 RECOMMENDATIONS                                     │
│                                                               │
│  1. [Action] — Expected impact: [quantified]                  │
│  2. [Action] — Expected impact: [quantified]                  │
│  3. [Action] — Expected impact: [quantified]                  │
│                                                               │
│  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   │
│  📎 APPENDIX                                                  │
│  - Jupyter Notebook: [link]                                   │
│  - Dashboard: [link]                                          │
│  - Data Source: [description]                                 │
└──────────────────────────────────────────────────────────────┘

Annotation — Nâng cấp Dashboard

Annotation — thêm text/callout trực tiếp vào chart để highlight insight. Đây là skill tạo sự khác biệt giữa dashboard bình thường và dashboard chuyên nghiệp.

Loại AnnotationKhi nào dùngTool
Reference LineTarget, benchmark, averagePower BI: Analytics pane / Tableau: Reference Line
Text CalloutHighlight specific data pointText box + arrow
Color HighlightEmphasize outlier or key segmentConditional formatting
Period HighlightMark campaign period, eventShaded region

Ví dụ Annotation

Revenue Trend — 12 Months
                    ↗ Campaign X launched
                   /   (+22% MoM)
                  /
    ──────────── /──────── ← Target: 500M
               /
              /
    ─────────/
    Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec

                    Q3 dip: supply chain issue
                    (−15% YoY, recovered in Oct)

Draft Writing Tips

Do ✅Don't ❌
Viết số cụ thể: "Revenue tăng 22%"Viết mập mờ: "Revenue tăng đáng kể"
So sánh: "vs Q2, vs target, vs industry"Số đứng một mình: "Revenue là 500M"
Action: "Recommend launch campaign X"Passive: "Có thể cân nhắc"
Prioritize: "Top 3 recommendations"List 15 recommendations không rank
1-2 trang max10 trang executive "summary"

🔗 Kết nối toàn bộ

Sprint trong hành trình Capstone

mermaid
flowchart LR
    A["Buổi 18<br/>🎯 Đề bài + Data"] --> B["Buổi 19<br/>🔬 Analysis + Dashboard"]
    B --> C["Buổi 20<br/>🎤 Present + Portfolio"]
    style B fill:#e8f5e9,stroke:#4caf50,stroke-width:3px
PhaseBuổiOutput
Kickoff18Problem statement, dataset, data audit
Sprint19EDA notebook, Dashboard v1, Executive Summary draft
Deliver20Final presentation, portfolio page, reflection

Mọi kỹ năng hội tụ ở Capstone

BuổiKỹ năngÁp dụng trong Sprint
3-4ExcelQuick data checks, pivot tables
5-6SQLData extraction, aggregation
7-8Python + PandasData cleaning, feature engineering
9EDAExploration, distributions, correlations
10VisualizationChart choices, annotation
11Power BI / TableauDashboard build
12Data StorytellingExecutive summary, What→So What→Now What
13Business MetricsKPI selection, funnel, cohort
15A/B TestingStatistical tests for comparisons
17Machine LearningPredictive model (nếu phù hợp)

Checklist "Sprint Hoàn Thành"

ANALYSIS:
✅ Data cleaned — no missing values in key columns
✅ EDA complete — distributions, correlations, segments
✅ 5 business questions answered with evidence
✅ Statistical tests applied (where appropriate)
✅ Findings documented — WHAT → SO WHAT → NOW WHAT

DASHBOARD:
✅ 3-5 pages built — Overview, Deep Dive, Insights
✅ KPI cards with period comparison
✅ Filters working correctly
✅ Colors & formatting consistent
✅ Peer review completed — top 3 issues fixed

EXECUTIVE SUMMARY:
✅ Draft written — 1-2 pages
✅ 5 key findings with evidence
✅ Top 3 recommendations with expected impact
✅ Appendix links to notebook + dashboard

📚 Tài liệu tham khảo

Tài liệuTác giảNội dung chính
Storytelling with DataCole Nussbaumer KnaflicDashboard design & annotation best practices
The Big Book of DashboardsSteve Wexler et al.28 real-world dashboards, design patterns
Lean AnalyticsAlistair Croll, Benjamin YoskovitzMetrics selection, startup analytics
SprintJake Knapp (Google Ventures)Sprint methodology cho design & analysis
Good ChartsScott Berinato (HBR)Chart selection, visual communication

🎯 Bài tập và thực hành

  1. Workshop: Analysis Sprint — Clean + EDA + Dashboard + Peer Review
  2. Case Study: Ví dụ capstone-level analysis — before/after dashboard
  3. Mini Game: Dashboard Sprint — Speed run build mini dashboard, Gold ≥ 80 XP
  4. Blog: Câu chuyện Mai — Scope creep, learning to focus
  5. Tiêu chuẩn: Code Review, Dashboard QA, Peer Review Framework