← All work

Customer Behaviour Analytics

Portfolio project · 2025
Power BIPostgreSQLPythonpandas
PDF
Case study
PDF
Python Highlights
PDF
SQL Highlights
Power BI — Customer Behaviour Dashboard.png
Power BI — Customer Behaviour Dashboard.png

Case Study 5 — Customer Shopping Behaviour Analysis

Role: Data Analyst (portfolio project) · Domain: Retail / e-commerce

Stack: Python (pandas) · PostgreSQL (pgAdmin) · Power BI · Excel

Deliverables: cleaned dataset · 10 business questions answered in SQL · interactive Power BI dashboard · written report + stakeholder presentation

Built on a public retail dataset used for portfolio purposes — no client or confidential data.

The Problem

A retailer had transactional data sitting in a spreadsheet but no view of who actually drives revenue. Leadership couldn't answer basic commercial questions: which customers are worth retaining, whether discounts are buying loyalty or just eroding margin, whether subscribers spend more, and which products deserve shelf priority. Raw transactions don't answer those — they have to be cleaned, modelled and asked the right questions.

What I Built

An end-to-end analytics pipeline, from raw file to boardroom-ready dashboard:

  1. Clean (Python / pandas) — loaded the data, profiled it with df.info() and .describe(), and handled missing values: 37 missing review ratings imputed with the median rating of their own product category, not a single global median and not by dropping the rows. Two deliberate choices there: the median because it isn't dragged by outliers the way the mean is, and per category because Clothing, Footwear and Accessories have genuinely different rating distributions — one blended average would have pulled ratings toward the middle and introduced bias into every category at once.
  2. Analyse (PostgreSQL) — loaded the cleaned data into Postgres and answered 10 business questions in SQL, using CTEs, window functions, conditional aggregation and subqueries.
  3. Visualise (Power BI) — built an interactive Customer Behaviour Dashboard with KPI cards, slicers (subscription, gender, category, shipping type) and revenue/sales breakdowns by category and age group.
  4. Communicate — wrote a structured report and a stakeholder presentation with prioritised recommendations.

The Data

Transactions3,900
Columns18
Missing values handled37 review ratings (category-wise median imputation)
Fieldsdemographics, purchase amount, category, item, review rating, discount, subscription, shipping type, previous purchases

The SQL Techniques

This project is where the SQL craft shows:

The Findings

QuestionResult
Headline KPIs3.9K customers · $59.76 average purchase · 3.75 average rating
Revenue by genderMale $157,890 vs Female $75,191
Customer segmentsLoyal 3,116 · Returning 701 · New 83
Revenue by age groupYoung Adult $62,143 · Middle-aged $59,197 · Adult $55,978 · Senior $55,763
Subscription mixOnly 27% of customers subscribe
ShippingExpress $60.48 vs Standard $58.46 average purchase
Top-rated productsGloves (3.86) · Sandals (3.84) · Boots (3.82)

What it means:

The Recommendations

What's in this case study

Skills demonstrated: end-to-end analytics pipeline · advanced SQL (CTEs · window functions · conditional aggregation · subqueries · type casting) · data cleaning & missing-value strategy (Python/pandas) · Power BI dashboard design · customer segmentation · commercial insight and stakeholder recommendations.