Skip to content

ak-dataanalytics/Retail-Sales-Dashboard

Repository files navigation

πŸ›’ Retail Sales Intelligence Dashboard

SQL Server + Power BI | 50,000+ Transactions | 2015–2018

Sales Overview


πŸ“Œ Project Summary

Designed and developed an end-to-end Business Intelligence solution analyzing 50,000+ retail transactions across 4 years (2015–2018). The project involved writing advanced SQL queries for data extraction and building an interactive 3-page Power BI dashboard to uncover revenue drivers, customer retention patterns, and product performance insights.

Tools: SQL Server Β· Power BI Desktop Β· DAX Β· Power Query
Dataset: 50,000+ retail transactions | 4 years | 4 regions | 3 product categories


🎯 Business Problem

A retail company needed answers to these critical questions:

  • Which regions and products drive the most revenue?
  • Are customers returning or buying only once?
  • Which year/quarter had the highest growth?
  • How are customers segmented by value (High/Mid/Low)?
  • What are the top-performing products and sub-categories?

πŸ“Š Key Findings & Business Insights

Metric Value Insight
πŸ’° Total Revenue $2,261,536 4-year cumulative
πŸ‘₯ Total Customers 793 Unique buyers
πŸ“¦ Total Products 1,861 Distinct SKUs
πŸ“ˆ Best Year 2018 ($7.2M) 20% YoY growth
🌍 Top Region West ($7.1M / 31%) Highest revenue region
πŸ‘‘ Top Customer Sean Miller ($25K) Highest lifetime value
πŸ” Repeat Customers 98.36% Extremely high retention
πŸ† Best Category Technology (36.59%) Revenue leader
πŸ“± Best Sub-category Phones Highest sub-category sales
πŸ₯‡ Top Product Canon imageCLASS ($62K) Revenue concentration

πŸ—‚οΈ Dashboard Pages

πŸ“„ Page 1 β€” Sales Overview

Sales Overview

Visuals:

  • 3 KPI Cards β€” Total Revenue, Total Customers, Total Products
  • Monthly Revenue Trend (Line Chart) β€” peaks in Nov/Dec (holiday season)
  • Yearly Revenue Growth (Column Chart) β€” consistent YoY growth
  • Revenue Trend 2015–2018 (Line Chart) β€” overall business trajectory

Key Insight: Revenue grew consistently from $4.8M (2015) β†’ $7.2M (2018) β€” 50% growth in 4 years


πŸ“„ Page 2 β€” Customer Analysis

Customer Analysis

Visuals:

  • Customer Segmentation Donut β€” A (High Value) / B (Mid Value) / C (Low Value)
  • Top 10 Customers Bar Chart β€” ranked by lifetime revenue
  • Revenue by Region Bar Chart β€” West dominates
  • Revenue by Category Pie Chart β€” Technology leads

Key Insight: 98.36% repeat customers β€” indicates extremely strong brand loyalty and customer retention


πŸ“„ Page 3 β€” Product Analysis

Product Analysis

Visuals:

  • Revenue by Category Treemap β€” Technology, Furniture, Office Supplies
  • Top 5 Products Bar Chart β€” revenue concentration analysis
  • Revenue by Sub-Category Bar Chart β€” all 17 sub-categories ranked

Key Insight: Top 5 products contribute significant revenue concentration β€” risk identified for business strategy


πŸ’Ύ SQL Analysis Performed

1. Revenue Analysis

-- Total Revenue, Customers, Products
SELECT ROUND(SUM(sales),2) AS total_sales,
       COUNT(DISTINCT customer_id) AS total_customer,
       COUNT(DISTINCT product_id) AS total_products
FROM sales

2. Month-over-Month Growth

WITH monthly_sales AS (
    SELECT FORMAT(order_date, 'yyyy-MM') AS month,
           ROUND(SUM(sales),2) AS revenue
    FROM sales
    GROUP BY FORMAT(order_date, 'yyyy-MM')
)
SELECT month, revenue,
    ROUND((revenue - LAG(revenue) OVER (ORDER BY month)) * 100.0
    / LAG(revenue) OVER (ORDER BY month), 2) AS growth_percent
FROM monthly_sales

3. Customer Segmentation (ABC Analysis)

SELECT customer_id, total_revenue,
    CASE
        WHEN cumulative_percent <= 70 THEN 'A - High Value'
        WHEN cumulative_percent <= 90 THEN 'B - Mid Value'
        ELSE 'C - Low Value'
    END AS customer_segment
FROM (
    SELECT customer_id, total_revenue,
        ROUND(SUM(total_revenue) OVER (ORDER BY total_revenue DESC
            ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) * 100.0
            / SUM(total_revenue) OVER (), 2) AS cumulative_percent
    FROM (
        SELECT customer_id, SUM(sales) AS total_revenue
        FROM sales GROUP BY customer_id
    ) t
) a

4. Year-over-Year Growth

SELECT year_month, revenue, prev_year_revenue,
    ROUND((revenue - prev_year_revenue) * 100.0
        / prev_year_revenue, 2) AS growth
FROM (
    SELECT year_month, revenue,
        LAG(revenue, 12) OVER (ORDER BY year_month) AS prev_year_revenue
    FROM (
        SELECT FORMAT(order_date, 'yyyy-MM') AS year_month,
               SUM(sales) AS revenue
        FROM sales
        GROUP BY FORMAT(order_date, 'yyyy-MM')
    ) s
) t

πŸ› οΈ Technical Skills Demonstrated

SQL Skills

Concept Usage
Window Functions LAG, DENSE_RANK, SUM OVER, ROWS BETWEEN
CTEs Month-over-month growth calculations
Subqueries Customer segmentation, revenue concentration
CROSS JOIN Percentage calculations
Date Functions FORMAT, DATEPART, DATENAME, DATEADD
Aggregations SUM, COUNT DISTINCT, AVG, ROUND

Power BI Skills

Skill Usage
Power Query Data transformation, custom columns
DAX Measures MoM Growth %, calculated KPIs
Data Modeling Table relationships, cardinality
Interactive Slicers Year and Region filters
Visualizations Line, Bar, Column, Donut, Pie, Treemap, Cards

πŸ“ Repository Structure

Retail-Sales-Dashboard/
β”‚
β”œβ”€β”€ πŸ“Š Retail_sales_dashboard.pbix    # Power BI Dashboard
β”œβ”€β”€ πŸ’Ύ business_insight_sql_analysis.sql  # All SQL Queries
β”œβ”€β”€ πŸ“ retail_sales_data.csv          # Raw Dataset
β”‚
β”œβ”€β”€ πŸ–ΌοΈ sales_overview.png             # Page 1 Screenshot
β”œβ”€β”€ πŸ–ΌοΈ customer_analysis.png          # Page 2 Screenshot
β”œβ”€β”€ πŸ–ΌοΈ product_analysis.png           # Page 3 Screenshot
β”‚
└── πŸ“„ README.md                      # Project Documentation

πŸš€ How to Use This Project

To explore SQL queries:

  1. Open business_insight_sql_analysis.sql in SQL Server Management Studio
  2. Create database storesales
  3. Import retail_sales_data.csv
  4. Run queries one by one

To view Power BI Dashboard:

  1. Download Retail_sales_dashboard.pbix
  2. Open in Power BI Desktop (free)
  3. Update data source to your SQL Server
  4. Explore all 3 pages with interactive slicers

πŸ“ˆ Business Impact

βœ… Identified West region as top revenue driver β†’ 
   focus marketing budget here

βœ… 98.36% repeat customers discovered β†’ 
   loyalty program already working well

βœ… Technology category leads revenue β†’ 
   increase inventory investment

βœ… Revenue grew 50% over 4 years β†’ 
   business is on strong growth trajectory

βœ… Top 5 products = revenue concentration risk β†’ 
   diversification strategy needed

πŸ”— Connect With Me

⭐ If you found this project helpful, please give it a star!

LinkedIn GitHub


Built with ❀️ using SQL Server & Power BI

About

Interactive Power BI dashboard analyzing 50K+ retail transactions using SQL Server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors