Skip to content

Latest commit

ย 

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›’ Retail Sales & Inventory Analytics Dashboard

Retail Sales & Inventory Analytics Dashboard built using SQL, Python, Power BI, and Excel.

๐Ÿ“Œ Project Overview

This project presents an end-to-end Retail Sales & Inventory Analytics solution built using SQL, Python, and Power BI. It analyzes over 100,000 retail transactions to uncover sales trends, customer behavior, inventory performance, and future sales forecasts through interactive dashboards and data-driven insights.


๐ŸŽฏ Objectives

  • Analyze retail sales performance.
  • Understand customer purchasing behavior.
  • Segment customers using RFM Analysis.
  • Perform ABC Inventory Analysis.
  • Forecast future sales using Machine Learning.
  • Build an interactive Power BI dashboard for business decision-making.

๐Ÿ›  Tech Stack

Technology Purpose
SQL Database Design & Analysis
MySQL Data Storage
Python Data Cleaning & Analysis
Pandas Data Manipulation
NumPy Numerical Computing
Matplotlib Data Visualization
Scikit-learn Sales Forecasting
Jupyter Notebook Development Environment
Power BI Interactive Dashboard
DAX KPI Measures
Excel / CSV Dataset Storage

๐Ÿ“‚ Project Structure

Retail-Sales-Inventory-Analytics/
โ”‚
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ clean_sales_data.csv
โ”‚   โ”œโ”€โ”€ customers.csv
โ”‚   โ”œโ”€โ”€ inventory.csv
โ”‚   โ”œโ”€โ”€ products.csv
โ”‚   โ””โ”€โ”€ sales.csv
โ”‚
โ”œโ”€โ”€ images/
โ”‚   โ”œโ”€โ”€ abc_analysis/...
โ”‚   โ”œโ”€โ”€ business_analysis/...
โ”‚   โ”œโ”€โ”€ dashboard_screenshots/...
โ”‚   โ”œโ”€โ”€ database/...
โ”‚   โ”œโ”€โ”€ forecasting/...
โ”‚   โ”œโ”€โ”€ python_eda/...
โ”‚   โ”œโ”€โ”€ rfm_analysis/...
โ”‚   โ”œโ”€โ”€ sql_advanced/...
โ”‚   โ””โ”€โ”€ sql_analysis/...
โ”‚
โ”œโ”€โ”€ powerbi/
โ”‚   โ”œโ”€โ”€ Retail_Sales_Analytics.pbix
โ”‚   โ””โ”€โ”€ theme.json
โ”‚
โ”œโ”€โ”€ python/
โ”‚   โ”œโ”€โ”€ abc_inventory_analysis.ipynb
โ”‚   โ”œโ”€โ”€ eda.ipynb
โ”‚   โ”œโ”€โ”€ generate_dataset.py
โ”‚   โ”œโ”€โ”€ rfm_analysis.ipynb
โ”‚   โ””โ”€โ”€ sales_forecasting.ipynb
โ”‚
โ”œโ”€โ”€ reports/
โ”‚   โ”œโ”€โ”€ abc_inventory_analysis.csv
โ”‚   โ”œโ”€โ”€ business_summary.csv
โ”‚   โ”œโ”€โ”€ customer_rfm_analysis.csv
โ”‚   โ”œโ”€โ”€ database_schema.md
โ”‚   โ””โ”€โ”€ sales_forecast.csv
โ”‚
โ”œโ”€โ”€ sql/
โ”‚   โ”œโ”€โ”€ queries.sql
โ”‚   โ””โ”€โ”€ schema.sql
โ”‚
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ .gitignore

โš™๏ธ Project Workflow

Dataset Generation
        โ”‚
        โ–ผ
MySQL Database
        โ”‚
        โ–ผ
SQL Analysis
        โ”‚
        โ–ผ
Python Data Cleaning
        โ”‚
        โ–ผ
EDA & Feature Engineering
        โ”‚
        โ–ผ
RFM Customer Segmentation
        โ”‚
        โ–ผ
ABC Inventory Analysis
        โ”‚
        โ–ผ
Sales Forecasting
        โ”‚
        โ–ผ
Power BI Dashboard
        โ”‚
        โ–ผ
Business Insights

๐Ÿ—„๏ธ Database Schema (ER Diagram)

The project is built on a relational database consisting of four primary tables:

  • ๐Ÿ“ฆ Products
  • ๐Ÿ‘ฅ Customers
  • ๐Ÿ›’ Sales
  • ๐Ÿฌ Inventory

The Sales table acts as the fact table and connects customer and product information, while Inventory stores warehouse stock details for each product.

ER Diagram


๐Ÿ“Š Dashboard Overview

The Power BI dashboard consists of four interactive pages.


๐Ÿ“ˆ 1. Executive Overview

Provides a high-level summary of business performance.

KPIs

  • ๐Ÿ’ฐ Total Sales
  • ๐Ÿ›’ Total Orders
  • ๐Ÿ‘ฅ Total Customers
  • ๐Ÿ“ฆ Total Products

Visualizations

  • Monthly Revenue Trend
  • Revenue by Category
  • Top 10 Cities by Revenue
  • Top 10 Products

๐Ÿ‘ฅ 2. Customer Analytics

Analyzes customer purchasing behavior using RFM Segmentation.

KPIs

  • ๐Ÿ‘ฅ Total Customers
  • ๐Ÿ’ฐ Average Customer Spend
  • ๐Ÿ› Average Order Value
  • ๐Ÿ“ˆ Customer Revenue

Visualizations

  • Customer Segment Distribution
  • Revenue by Customer Segment
  • Top 10 Customers
  • Customer Segment Summary

๐Ÿ“ฆ 3. Inventory Analytics

Provides inventory optimization insights using ABC Analysis.

KPIs

  • ๐Ÿ“ฆ Total Inventory Value
  • ๐Ÿ› Total Products
  • โš ๏ธ Low Stock Products
  • ๐Ÿ’š Healthy Inventory
  • ๐Ÿข Warehouses

Visualizations

  • ABC Category Distribution
  • Inventory Value by ABC Category
  • Current Stock by Category
  • Top Inventory Products

๐Ÿ“ˆ 4. Sales Forecast & Trends

Forecasts future sales using Linear Regression.

KPIs

  • ๐Ÿ’ฐ Total Sales
  • ๐Ÿ“ˆ Total Profit
  • ๐Ÿ›’ Average Order Value
  • ๐Ÿ“Š Forecast Growth
  • ๐Ÿ”ฎ Average Forecast Sales

Visualizations

  • Monthly Revenue Trend
  • Six-Month Sales Forecast
  • Forecast Table
  • Model Evaluation
  • Forecast Summary

๐Ÿ“Š Key Business Insights

๐Ÿ’ฐ Sales Insights

  • Generated over โ‚น1.09 Billion in total revenue.
  • Revenue remained relatively stable throughout the analysis period.
  • Electronics generated the highest revenue among all product categories.
  • Top-selling products contributed significantly to overall sales.

๐Ÿ‘ฅ Customer Insights

  • Nearly half of customers belong to the Regular Customers segment.
  • Champions and Loyal Customers generated the highest average spending.
  • A relatively small percentage of customers contributed disproportionately to revenue.
  • Customer segmentation provides opportunities for targeted marketing campaigns.

๐Ÿ“ฆ Inventory Insights

  • Category A products account for the majority of inventory value.
  • Inventory value is highly concentrated among a small number of products.
  • Multiple products fall below the reorder level, highlighting restocking priorities.
  • Current stock levels vary across product categories.

๐Ÿ“ˆ Forecast Insights

  • Monthly sales remain relatively stable with moderate fluctuations.
  • Linear Regression achieved an Rยฒ Score of 0.008, indicating a weak linear relationship.
  • The six-month forecast suggests a slight upward trend in expected sales.
  • More advanced time-series models (ARIMA or Prophet) could improve forecast accuracy.

๐Ÿค– Machine Learning

Model

  • Linear Regression

Evaluation

  • Rยฒ Score: 0.008

Future Improvements

  • Prophet Forecasting
  • ARIMA
  • XGBoost Regression
  • LSTM Time-Series Forecasting

๐Ÿ“ Reports

The project includes automatically generated reports:

  • Business Summary
  • Customer RFM Analysis
  • ABC Inventory Analysis
  • Sales Forecast
  • Database Schema Documentation

๐Ÿš€ Skills Demonstrated

  • SQL Query Writing
  • Database Design
  • Data Cleaning
  • Exploratory Data Analysis
  • Customer Segmentation
  • Inventory Optimization
  • Machine Learning
  • Sales Forecasting
  • Data Visualization
  • Dashboard Design
  • Power BI
  • DAX
  • Business Analytics

๐Ÿ“ธ Dashboard Screenshots

๐Ÿ  Executive Overview

Executive Overview


๐Ÿ‘ฅ Customer Analytics

Customer Analytics


๐Ÿ“ฆ Inventory Analytics

Inventory Analytics


๐Ÿ“ˆ Sales Forecast & Trends

Sales Forecast


๐Ÿ“ท Analysis Snapshots

SQL Analysis

SQL Analysis

Python EDA

Python EDA

RFM Analysis

RFM Analysis

ABC Inventory Analysis

ABC Analysis

Forecasting

Forecast

Business Analysis

Correlation Matrix


โšก Installation

Clone the repository

git clone https://github.com/your-username/Retail-Sales-Inventory-Analytics.git

Move into the project directory

cd Retail-Sales-Inventory-Analytics

Install dependencies

pip install -r requirements.txt

Open the notebooks

jupyter notebook

Open Power BI dashboard

powerbi/Retail_Sales_Analytics.pbix

๐Ÿ“ˆ Future Enhancements

  • Deploy dashboard online using Power BI Service.
  • Integrate live SQL database.
  • Build automated ETL pipeline.
  • Implement Prophet forecasting.
  • Add customer churn prediction.
  • Perform demand forecasting using advanced ML models.

๐Ÿ‘จโ€๐Ÿ’ป Author

Abhishek

B.Tech Computer Science Engineering

Aspiring Data Analyst | Business Intelligence Analyst | Analytics Engineer


โญ If you found this project helpful, consider giving it a star!

About

End-to-end Retail Sales & Inventory Analytics project using SQL, Python, and Power BI featuring RFM segmentation, ABC inventory analysis, sales forecasting, and interactive dashboards.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages