Nonso Ezeoma
End-to-end BI & automation
Flagship project · data to decision, hands-off

Customer-retention system — Nordwind

An end-to-end customer-retention system for an e-commerce store (“Nordwind”). It cleans the raw sales, scores every customer, measures who is drifting away, shows it on a live Power BI dashboard, and re-runs itself every week on GitHub — opening an alert with an AI-written briefing whenever the revenue at risk climbs too high.

Why it matters

Turns a pile of raw sales into one number a manager can act on — £1.32M of revenue sitting with 1,708 customers who are slipping away — then refreshes it, alerts on it, and explains it in plain English every week, with no one touching it.

£1.32M
revenue flagged at risk, automatically
4,338
customers scored by RFM
Weekly
pipeline re-runs itself on GitHub
AI
plain-language briefing every run

01The problem

02How the system works, end to end

Seven stages run as one automated pipeline — from raw data to an AI-written briefing.

  1. Clean 540,000+ raw transactions into trustworthy sales (Python / pandas).
  2. Score every customer by Recency, Frequency and Monetary value, and sort them into plain groups — Champions, Loyal, At Risk, Lost.
  3. Measure retention over time with a cohort analysis, and flag the revenue at risk (At Risk + Lost).
  4. Visualise it on a two-page Power BI dashboard — an executive overview and a retention deep-dive.
  5. Automate the whole run on GitHub Actions — a fresh cloud machine does it every week, with no clicks.
  6. Alert — when revenue at risk crosses a threshold, it opens an issue with the win-back customer list and emails it.
  7. Explain — an AI step (Google Gemini) writes a plain-language briefing of the week and the top 3 actions.

LIVEThe dashboard

Power BI · rebuilt here from the pipeline data
£10.63M
Total revenue analysed
4,338
Customers identified
66%
Repeat-customer rate
£1.32M
Revenue at risk
Executive overview
Monthly revenue across the trading year.
£0.0M£0.8M£1.5MDec '10JanFebMarAprMayJunJulAugSepOctNovDec '11
monthly revenue, GBP · Dec 2011 is partial (data ends 9 Dec)
Where the revenue sits
Revenue by customer segment — the top two groups hold most of the money.
Champions5.91MLoyal1.35MAt Risk0.8MLost0.52MNeeds Attention0.16MNew / Promising0.15M
revenue by segment, GBP millions · Champions + Loyal = ~82% of segmented revenue
How many customers in each group
Customer counts by segment — more than 1,700 sit in At Risk or Lost.
Champions1,139Lost1,065Loyal821At Risk643Needs Attention351New / Promising319
Champions / loyalLoyalAt Risk + LostOther
Cohort retention
Of each month's new customers, the share still buying N months later. Darker = more retained.
CohortM0M1M2M3M4M5M6M7M8M9M10M11M12
2010-12
n=885
100373238364036353540375027
2011-01
n=417
1002227233229252430333612
2011-02
n=380
1001919282725252825307
2011-03
n=452
10015252022172723289
2011-04
n=300
100212021202322267
2011-05
n=284
10019171721232610
2011-06
n=242
100171626233410
2011-07
n=188
1001821222711
2011-08
n=169
10021252412
2011-09
n=299
100233011
2011-10
n=358
1002412
2011-11
n=323
10011
2011-12
n=41
100
read across a row: month 0 is always 100% · the Dec 2010 cohort stays the stickiest
Top customers at risk — win-back priority
The biggest past spenders who have gone quiet — exactly who the alert emails each week.
CustomerSegmentOrdersSpendLast seen
12346Lost1£77,184326 days
15749At Risk3£44,534235 days
15098At Risk3£39,916182 days
12409At Risk3£11,07379 days
16180At Risk8£10,254100 days
12590Lost2£9,864211 days
13093At Risk8£7,832276 days
12435Lost2£7,83080 days

03The hands-off loop

AI briefing · auto-generated each run

“We crossed our warning threshold this week with £1.32M in revenue at risk; 1,708 accounts have gone quiet. Top 3 actions: call top at-risk buyers 15749 (£44,534) and 15098 (£39,916); send a “we miss you” campaign to all 643 at-risk customers; investigate why the biggest lost buyer, 12346 (£77,184), stopped ordering.”

04Tools & method

PythonpandasPower BIDAXRFM & cohort analysisGitHub Actions (CI/CD)Google Gemini APIPrompt engineering
View on GitHubRead a live AI briefing