Customer churn directly impacts revenue. The goal of this project is to identify users at risk of churn and recommend actions to retain them.
Transaction-level dataset containing:
user_idorder_idorder_dateamount
- Removed invalid dates
- Removed negative/refund amounts
- Eliminated duplicate records
-
Converted event-level data to user-level
-
Used SQL window functions:
ROW_NUMBER()→ sequence purchasesLAG()→ track previous order behavior
Users are marked as at risk if:
- No purchase in the last 30 days (Inactivity)
- Last two purchases show declining spend
- 20% of users are at risk of churn
- High-value users are becoming inactive
- Some users show consistent decline in spending behavior
- Re-engage inactive users with personalized campaigns
- Use upsell/cross-sell strategies for declining users
- Prioritize high-value users to maximize impact
- KPI cards (Total Users, At-Risk Users, % At Risk)
- Risk distribution by reason
- Priority list of at-risk users
- Key insights and recommended actions
- SQL (Data cleaning & transformation)
- Power BI (Dashboard & visualization)
customer-churn-analysis/
│
├── churn_analysis.sql
├── churn_dashboard.pbix
├── orders.csv
├── README.md
- Open SQL file to understand data transformation logic
- Load dataset into Power BI
- Open
.pbixfile to explore dashboard
- Include user segmentation (high/low value users)
- Add time-based churn prediction
- Scale analysis with larger datasets