This project involves a comprehensive analysis of an online pharmacy's sales data. The goal was to transform raw datasets into an interactive Power BI dashboard, providing insights into sales performance, customer behavior, and product associations to drive strategic business decisions.
The analysis aimed to:
- Clean and prepare raw data for analysis.
- Extract key insights across sales, customer behavior, and product performance.
- Conduct advanced RFM segmentation to classify customers.
- Perform market basket analysis to uncover cross-sell opportunities.
- Build an interactive dashboard to present a clear business story.
The analysis uses three primary datasets:
- orders_fact.csv: Contains order-level information (
order_id,customer_id,order_date). - order_products_fact.csv: Contains line-item details for each order (
order_id,product_id,quantity,unit_price,sales). - products_dimension.csv: Contains product information (
product_id,product_name,category,subcategory,unit_price).
I built a Star Schema data model in Power BI for optimal performance and simplicity:
- Fact Tables:
orders_fact,order_products_fact - Dimension Tables:
products_dimension,Date(custom created date table) - Relationships: Established one-to-many relationships between dimension and fact tables.
- Total Sales, Total Orders, Unique Customers
- Average Order Value (AOV), Average Items per Order
- RFM Customer Segmentation:
- Calculated Recency, Frequency, and Monetary value for each customer.
- Scored each dimension (1-5) and segmented customers into categories: Champions, Loyal Customers, At Risk, Lost Customers.
- Market Basket Analysis (Association Rules):
- Created a product pairs table to identify frequently bought-together items.
- Calculated pair frequency to derive top cross-selling opportunities.
The interactive Power BI report consists of three pages:
- Executive Summary: High-level overview of KPIs, monthly sales trends, top products, and basket size distribution.
- Customer Analysis: Deep dive into RFM segments with a donut chart, detailed table, and sales by segment.
- Product & Basket Analysis: Features top product pairs and a drill-through product hierarchy matrix. Includes actionable insights and recommendations.
- Power BI: Data cleaning, data modeling, DAX, visualization, and dashboard design.
- Power Query (M): Used for data transformation and cleaning.
- Download the
Elezaby_Analytics.pbixfile. - Open it in Power BI Desktop.
- Interact with the slicers and visuals to explore the data. Use the drill-down features in the matrix visual to explore product categories.
- Loyalty Program: A small segment of "Champion" customers drives most revenue. Implement a loyalty program with exclusive offers to retain them.
- Product Bundling: Top product pairs (e.g., Shampoo & Conditioner) should be bundled and promoted via a "Frequently Bought Together" widget.
- Checkout Optimization: Since most orders are 1-2 items, implement add-on suggestions at checkout to increase average basket size.
Elezaby-Ecommerce-Analytics/
│
├── Data/ (optional - add raw CSVs if you can)
│ ├── orders_fact.csv
│ ├── order_products_fact.csv
│ └── products_dimension.csv
│
├── Assets/ (optional - add screenshot of dashboard)
│ └── dashboard_overview.png
│
├── Elezaby_Analytics.pbix
└── README.md
Mahmoud Abdallah