Skip to content
Case Study 01 · Customer Analytics

Retail customer segmentation built for commercial decisions.

An end-to-end analytics project that transformed online grocery transaction data into customer-level behaviour features, priority tiers, strategic customer segments, and a Power BI dashboard for retention, reactivation, upsell, and campaign targeting decisions.

Python pandas Power BI DAX Customer Segmentation Commercial Analytics
Project overview

From transaction data to customer action groups

The project was designed around a practical commercial question: which customers should a retail team protect, grow, upsell, reactivate, or simply monitor?

Business problem

A large online grocery customer base is difficult to act on when every customer is treated the same. The goal was to convert raw order behaviour into clear customer groups that could support CRM, marketing, retention, and commercial planning.

Analytical goal: move beyond descriptive totals and create a segmentation model that connects behaviour, value, demographics, and targeting actions.

Final output

The final deliverable was a Power BI dashboard fed by structured Python exports: a customer-level segmentation table, strategic segment summaries, behaviour and priority summaries, demographic cuts, and transaction-level product/department targeting tables.

The dashboard was built to help stakeholders quickly identify high-value customers, active growth groups, stable mid-value segments, and the largest reactivation pools.

Customer records206,209one row per customer in the final segmentation table
Transaction rows32.4Mtransaction-level file preserved after merging segments
Strategic segments11mapped to protect, grow, maintain, and reactivate actions
Power BI exports8prepared CSV tables for dashboard reporting
Python workflow

How the analysis was built

The Python work converted raw order, product, customer, demographic, and transaction-level data into a dashboard-ready analytics model.

01
Data checksProfiled source tables, checked structures, validated keys, and prepared the data for reliable merging.
02
Profiling & mergingCombined customer, product, department, order, and transaction-level fields into a usable master dataset.
03
Customer aggregationBuilt one row per customer with order frequency, unique products, price behaviour, reordered items, line items, and reorder rate.
04
Behaviour scoreCreated percentile ranks and a weighted behaviour score to compare customers across multiple behavioural signals.
05
Behaviour segmentationAssigned 9 behaviour segments such as Champions, Loyal Repeat Buyers, Premium Basket Buyers, Light Buyers, and Low Engagement Customers.
06
Demographic bandsAdded region, age group, income group, household group, and a combined demographic profile for Power BI slicing.
07
Strategic segmentationCombined priority level, income, household, price, and order signals into 11 action-focused strategic target segments.
08
Transaction mergeMerged the customer-level segmentation back onto the transaction-level dataset while preserving the full row count.
09
Power BI exportsGenerated 8 clean CSV files for the dashboard, from customer-level data to product-level targeting summaries.
Scoring model

A behaviour score built from four customer signals

Instead of relying on a single metric, customers were scored using a weighted blend of order frequency, reorder loyalty, product breadth, and product price behaviour.

Weighted behaviour score

The score was designed to separate customers by engagement, loyalty, breadth, and premium/value tendency while keeping each input comparable through percentile ranks.

40%Order frequency percentile rank
30%Reorder loyalty percentile rank
20%Product breadth percentile rank
10%Average product price percentile rank
Score ≥ 0.80High Priority

24,852 customers. The strongest retention and loyalty protection group.

0.60–0.80Growth Priority

50,055 customers. Active shoppers with clear growth, upsell, or cross-sell potential.

0.40–0.60Maintain

54,017 customers. Stable middle-tier customers requiring monitoring and selective action.

< 0.40Low Priority

77,285 customers. The largest group, mostly suited to reactivation or low-cost recovery campaigns.

Power BI customer segmentation and purchase behaviour dashboard preview
Strategic segmentation

11 customer groups mapped to business actions

The final model grouped customers into practical commercial actions rather than purely statistical labels.

Protect

High-priority customers with the strongest behavioural value.

  • High-Value Repeat Customers11,972
  • Highly Engaged Customers12,880

Grow

Active customers with clear potential for deeper targeting.

  • Affluent Active Customers6,118
  • Active Family Shoppers30,628
  • Active Value-Conscious Customers2,073
  • Broad Basket Explorers11,236

Maintain

Mid-tier customers where action depends on price and frequency signals.

  • Premium Higher Price Buyers16,422
  • Frequent Low-Price Buyers13,167
  • Stable Mid-Value Customers24,428

Reactivate

Low-priority customers where the key question is whether recovery is worth the cost.

  • Low-Engagement Families54,315
  • Low-Engagement Customers22,970
Power BI dashboard

Dashboard pages built around stakeholder questions

The Power BI report was structured to move from a high-level segmentation overview into behaviour, demographic, and targeting detail.

01

Executive Segmentation Overview

Shows customer volume, priority tiers, strategic segments, KPI cards, and the broad distribution of customers across action groups.

02

Behavioural Analysis

Compares customer groups by order frequency, reorder loyalty, product breadth, product price behaviour, and behaviour score.

03

Demographic Insights

Focuses on age, income, household group, and demographic profiles because those dimensions explain more useful differences than region alone.

Business insights

What the segmentation made easier to decide

The dashboard turns customer complexity into practical campaign and commercial priorities.

Reactivation is the largest opportunity

Low Priority customers represent 77,285 customers, with Low-Engagement Families alone accounting for 54,315 customers. That creates a clear reactivation pool, but the campaign cost must be controlled.

Active family shoppers deserve a growth path

Grow Active Family Shoppers is the largest growth-tier segment at 30,628 customers, making it a strong candidate for family-oriented offers, bundles, and category expansion campaigns.

High-priority customers need protection

The two Protect segments together represent 24,852 customers with the strongest engagement profile. These customers are better suited to loyalty protection, premium retention, and service-led messaging than generic discounting.

Maintain is not one uniform middle group

The Maintain tier was split into premium buyers, frequent low-price buyers, and stable mid-value customers so that the business can separate selective upsell from simple monitoring.

Technical validation

Checked for refresh, logic, and reporting reliability

The project included validation beyond visual design: data checks, row-count assertions, segment exhaustiveness, no-null checks, Power Query review, DAX measure review, and slicer state checks after the CSV rebuild.

Validation that protects trust

A segmentation dashboard only works if the segment logic, refresh process, and dashboard measures remain consistent after the data is rebuilt.

Customer-level validation: every customer received a priority level, behaviour segment, demographic profile, and strategic target segment.
Transaction-level validation: 32,398,592 transaction rows were preserved after segmentation fields were merged back to line-level data.
Dashboard validation: Power Query locale, encoding, segment labels, DAX dependencies, and stale slicer selections were checked during the Power BI rebuild.
Customer segmentation CSV

206,209 rows with demographics, behaviour metrics, percentile ranks, priority level, behaviour segment, and strategic target segment.

Strategic summaries

Aggregated strategic, priority, behaviour, region, and demographic summary tables for Power BI visuals.

Department targeting table

Transaction-aggregated table by segment, priority, behaviour group, and department for category-level targeting.

Product targeting table

Large product-level targeting export by segment, department, product, unique customers, unique orders, price, and reorder rate.

Recommendations

How the business could use the dashboard

Protect: prioritise retention, loyalty rewards, and premium customer treatment for the strongest engagement groups.

Grow: target active family shoppers, affluent active customers, and broad basket explorers with relevant bundle, category, and cross-sell campaigns.

Maintain: monitor stable mid-value customers, selectively upsell frequent low-price buyers, and preserve premium buyer value without over-discounting.

Reactivate: test low-cost recovery campaigns for low-engagement families and broader low-engagement customers before investing heavily.

Tools & deliverables

What this project demonstrates

This case study demonstrates Python data preparation, customer-level feature engineering, segmentation logic, Power BI dashboard design, DAX-based reporting measures, quality checks, and the ability to translate analysis into stakeholder-ready recommendations.

Python pandas Jupyter Power BI DAX Power Query CSV Exports Customer Analytics

Need the full portfolio or resume?

Download the PDF portfolio for a polished overview of the projects, or open the resume for the formal career summary, tools, and work history.