Skip to content

Latest commit

Β 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š Retail Sales Analytics Dashboard

SQL Server Power BI Python Pandas License GitHub last commit GitHub repo size

An end-to-end Retail Sales Analytics project that demonstrates the complete Business Intelligence workflowβ€”from raw CSV data to exploratory data analysis, SQL database design, data normalization, business analysis, and an interactive Power BI dashboard.

The project showcases practical skills in Python, SQL Server, T-SQL, Power BI, Data Modeling, ETL, DAX, and Business Intelligence, transforming raw retail sales data into actionable business insights through interactive reporting and visualization.


πŸ“Œ Overview

Retail businesses generate thousands of sales transactions across different products, customers, markets, and regions. Converting this raw transactional data into meaningful business insights is essential for strategic decision-making.

This project builds a complete Retail Sales Analytics solution by following the end-to-end data analytics lifecycle:

  • Performing Exploratory Data Analysis (EDA) using Python
  • Designing a normalized SQL Server database
  • Loading and transforming raw sales data
  • Writing SQL queries to answer business questions
  • Building an interactive Power BI dashboard
  • Presenting KPIs and visual insights for decision-makers

The final dashboard enables users to monitor sales performance, profitability, product trends, customer behavior, and market performance through an intuitive and interactive interface.


⭐ Project Highlights

  • πŸ“Š Executive Power BI Dashboard
  • πŸ’° Sales & Profit KPI Reporting
  • πŸ“ˆ Sales Trend Analysis
  • πŸ›οΈ Top 5 Products Analysis
  • 🌍 Market Performance Analysis
  • πŸ‘₯ Customer Sales Insights
  • πŸ“¦ Product Category Analysis
  • 🧹 Data Cleaning & Transformation
  • πŸ—„οΈ SQL Database Design & Normalization
  • πŸ“Š Interactive Slicers & Filters
  • πŸ“ˆ DAX Measures & KPI Calculations
  • πŸ“‰ Business Intelligence Reporting

πŸ“Έ Dashboard Preview

Retail Sales Executive Dashboard

Retail Sales Dashboard


πŸ’Ό Business Problem

Retail organizations collect large volumes of transactional data every day. Without proper analysis, it becomes difficult to identify sales trends, evaluate profitability, monitor product performance, or understand customer purchasing behavior.

Business managers require a centralized reporting solution that provides real-time insights into key performance indicators (KPIs), enabling them to:

  • Monitor overall sales and profit performance
  • Identify top-performing products and categories
  • Compare sales across different markets
  • Track sales trends over time
  • Analyze customer segments
  • Support data-driven business decisions

This project addresses these challenges by integrating SQL-based data processing with Power BI visualization to deliver an executive-level sales analytics dashboard.


πŸ”„ Analytics Workflow

The project follows a complete end-to-end Business Intelligence workflow, transforming raw retail sales data into actionable business insights.

                    Raw Retail Dataset (CSV)
                              β”‚
                              β–Ό
                Exploratory Data Analysis (Python)
                              β”‚
                              β–Ό
                  Data Cleaning & Validation
                              β”‚
                              β–Ό
                SQL Server Database Creation
                              β”‚
                              β–Ό
                 Staging Table & Data Loading
                              β”‚
                              β–Ό
                  Database Normalization
                              β”‚
                              β–Ό
                 Business Analysis using SQL
                              β”‚
                              β–Ό
                  Power BI Data Modeling
                              β”‚
                              β–Ό
                   DAX Measure Creation
                              β”‚
                              β–Ό
                Interactive Executive Dashboard
                              β”‚
                              β–Ό
                  Business Insights & Reporting

πŸ› οΈ Tech Stack

Category Technology
🐍 Programming Language Python
πŸ““ Notebook Environment Jupyter Notebook
πŸ“Š Data Analysis Pandas
πŸ—„οΈ Database SQL Server
πŸ’Ύ Query Language T-SQL
🧹 Data Cleaning SQL & Pandas
πŸ—οΈ Data Modeling SQL Server, Power BI
πŸ“ˆ Business Intelligence Power BI
πŸ“ DAX Measures & KPIs
πŸ”„ Version Control Git
☁️ Repository Hosting GitHub

πŸ“‚ Project Structure

Retail-Sales-Analytics/
β”‚
β”œβ”€β”€ dashboard/
β”‚   └── RetailSalesAnalytics.pbix
β”‚
β”œβ”€β”€ dataset/
β”‚   └── raw/
β”‚       └── superstore.csv
β”‚
β”œβ”€β”€ images/
β”‚   └── dashboard.png
β”‚
β”œβ”€β”€ notebooks/
β”‚   β”œβ”€β”€ 01_EDA.ipynb
β”‚   └── 02_Load_Data_To_SQL.ipynb
β”‚
β”œβ”€β”€ sql/
β”‚   β”œβ”€β”€ 01_Create_Database.sql
β”‚   β”œβ”€β”€ 02_Create_Staging_Table.sql
β”‚   β”œβ”€β”€ 03_create_normalized_tables.sql
β”‚   β”œβ”€β”€ 04_populate_normalized_tables.sql
β”‚   └── 05_business_analysis.sql
β”‚
β”œβ”€β”€ README.md
└── .gitignore

πŸ“ Dataset

The project uses the Superstore Sales Dataset, a widely used dataset for learning and demonstrating Business Intelligence, SQL, and Power BI concepts.

The dataset contains transactional sales records, including:

  • πŸ›’ Orders
  • πŸ‘₯ Customers
  • πŸ“¦ Products
  • 🏷️ Categories & Subcategories
  • 🌍 Markets & Regions
  • πŸ’° Sales
  • πŸ“ˆ Profit
  • 🎯 Discounts
  • 🚚 Shipping Information
  • πŸ“… Order & Ship Dates

Dataset Location

dataset/
└── raw/
    └── superstore.csv

The dataset is first explored using Python, then imported into SQL Server, normalized into relational tables, and finally connected to Power BI for interactive reporting.


πŸ—„οΈ SQL Workflow

The SQL phase of this project transforms raw transactional data into a structured relational database and performs business analysis using T-SQL.

The workflow consists of five major stages:

1️⃣ Database Creation

  • Create the Retail Sales Analytics database
  • Configure the database environment

2️⃣ Staging Table Creation

  • Create a staging table matching the raw CSV structure
  • Prepare the database for data loading

3️⃣ Database Normalization

The staging table is normalized into multiple relational tables to eliminate redundancy and improve data integrity.

The normalized schema includes:

  • Customers
  • Products
  • Orders
  • Locations
  • Sales (Fact Table)

4️⃣ Data Population

  • Populate normalized tables from the staging table
  • Maintain primary and foreign key relationships

5️⃣ Business Analysis

Perform SQL analysis to answer real-world business questions using joins, aggregations, Common Table Expressions (CTEs), and Window Functions.


πŸ“Š Business Analysis

The project answers 25 business questions across multiple analytical domains.

πŸ’° Sales Performance

  • Overall sales performance
  • Business size overview
  • Sales by category
  • Sales by subcategory
  • Sales by market
  • Sales by region

πŸ“ˆ Profit Analysis

  • Profit by category
  • Most profitable products
  • Least profitable products

πŸ“¦ Product Analysis

  • Top 10 best-selling products
  • Highest profit-generating products
  • Products performing above average
  • Top 3 products in each category

πŸ‘₯ Customer Analysis

  • Top customers by sales
  • Top customers by profit
  • Customers with the highest number of orders
  • Customer contribution to total sales

🌍 Geographic Analysis

  • Market-wise sales
  • Region-wise sales

πŸ“… Time-Based Analysis

  • Yearly sales trend
  • Weekly sales trend
  • Running yearly sales
  • Year-over-year sales growth

🚚 Operational Analysis

  • Sales by shipping mode
  • Order priority analysis

⚑ Advanced SQL Concepts

The project demonstrates several advanced SQL concepts, including:

  • INNER JOIN
  • Common Table Expressions (CTEs)
  • Window Functions
  • ROW_NUMBER()
  • RANK()
  • DENSE_RANK()
  • LAG()
  • Running Totals
  • Aggregate Functions
  • GROUP BY
  • ORDER BY

πŸ“Š Power BI Dashboard

The SQL database is connected to Power BI to create an interactive executive dashboard for business decision-making.

The dashboard includes:

πŸ“Œ Executive KPI Cards

  • πŸ’° Total Sales
  • πŸ’΅ Total Profit
  • πŸ“¦ Total Orders
  • πŸ›’ Total Quantity Sold
  • πŸ“ˆ Profit Margin %
  • 🏷️ Average Discount %

πŸ“ˆ Interactive Visualizations

πŸ“Š Sales by Category

Compare total sales across product categories.

πŸ“… Sales Trend (Yearly)

Visualize yearly sales performance and identify long-term trends.

πŸ›οΈ Top 5 Products by Sales

Identify the highest revenue-generating products.

🌍 Sales by Market

Compare sales performance across different markets.


πŸŽ›οΈ Interactive Slicers

Users can dynamically filter the dashboard using:

  • πŸ“… Year
  • 🌍 Market
  • πŸ‘₯ Segment
  • πŸ“¦ Category

All dashboard visuals update automatically based on the selected filters.


πŸ’‘ Key Business Insights

The analysis provides valuable insights into retail sales performance, including:

  • Identification of high-performing product categories.
  • Recognition of top revenue-generating products.
  • Comparison of sales performance across markets and regions.
  • Evaluation of yearly and weekly sales trends.
  • Analysis of customer purchasing behavior.
  • Assessment of shipping mode performance.
  • Measurement of customer contribution to total revenue.
  • Product ranking using advanced SQL window functions.
  • Year-over-year sales growth analysis.
  • Executive KPI reporting for business decision-making.

πŸš€ Installation

1. Clone the Repository

git clone https://github.com/harsh8767/Retail-Sales-Analytics.git

2. Navigate to the Project Directory

cd Retail-Sales-Analytics

3. Explore the Dataset

The raw retail dataset is available at:

dataset/
└── raw/
    └── superstore.csv

You can use the dataset for:

  • Exploratory Data Analysis (Python)
  • SQL Server Data Loading
  • Power BI Dashboard Development

4. Execute SQL Scripts

Run the SQL scripts in the following order:

  1. 01_Create_Database.sql
  2. 02_Create_Staging_Table.sql
  3. 03_create_normalized_tables.sql
  4. 04_populate_normalized_tables.sql
  5. 05_business_analysis.sql

This will:

  • Create the database
  • Create the staging table
  • Normalize the data
  • Populate relational tables
  • Execute business analysis queries

5. Open the Power BI Dashboard

Open the Power BI project located in:

dashboard/
└── RetailSalesAnalytics.pbix

If required, update the SQL Server connection and refresh the data model.


▢️ Using the Dashboard

The Power BI dashboard is fully interactive.

Use the slicers to filter the report by:

  • πŸ“… Year
  • 🌍 Market
  • πŸ‘₯ Segment
  • πŸ“¦ Category

The dashboard updates all KPI cards and visualizations dynamically based on the selected filters.


πŸ“Š Dashboard Components

KPI Cards

  • Total Sales
  • Total Profit
  • Total Orders
  • Total Quantity Sold
  • Profit Margin %
  • Average Discount %

Visualizations

  • πŸ“Š Sales by Category
  • πŸ“ˆ Sales Trend (Yearly)
  • πŸ›οΈ Top 5 Products by Sales
  • 🌍 Sales by Market

πŸ“ Dataset Information

The project uses the Superstore Sales Dataset, which contains transactional retail sales data across multiple business dimensions.

Dataset includes:

  • Customer Information
  • Product Details
  • Orders
  • Categories
  • Subcategories
  • Sales
  • Profit
  • Discounts
  • Quantity
  • Shipping Details
  • Markets
  • Regions
  • Countries
  • Order Dates
  • Ship Dates

The dataset was cleaned, normalized, and transformed before being used for business analysis and visualization.


πŸš€ Future Improvements

Potential enhancements for future versions include:

  • πŸ“ˆ Month-over-Month (MoM) Sales Analysis
  • πŸ“Š Year-over-Year (YoY) Growth Dashboard
  • πŸ“¦ Inventory Analytics
  • πŸ‘₯ Customer Segmentation
  • 🎯 Customer Lifetime Value (CLV) Analysis
  • πŸ“ Geographic Mapping Visualizations
  • πŸ” Drill-through Reports
  • πŸ“± Mobile Dashboard Layout
  • πŸ” Row-Level Security (RLS)
  • πŸ€– Sales Forecasting with Machine Learning

πŸ™ Acknowledgements

This project was built using the following technologies and tools:

  • Microsoft SQL Server
  • Power BI Desktop
  • Python
  • Pandas
  • Jupyter Notebook
  • Git
  • GitHub

Special thanks to the open-source community for providing learning resources and tools that made this project possible.


πŸ‘¨β€πŸ’» Developer

Harsh Chavan

Passionate about Data Analytics, Business Intelligence, SQL, Power BI, Python, Machine Learning, and Artificial Intelligence.

πŸ“« Connect with Me

GitHub

https://github.com/harsh8767

LinkedIn

https://www.linkedin.com/in/harsh-chavan-1646a2257/


πŸ“œ License

This project is licensed under the MIT License.

Feel free to use, modify, and distribute this project in accordance with the terms of the license.

See the LICENSE file for more information.


⭐ Support

If you found this project helpful or interesting:

  • ⭐ Star this repository
  • 🍴 Fork this repository
  • πŸ’‘ Share your feedback
  • πŸ› Report issues
  • πŸš€ Suggest improvements

Your support is greatly appreciated!


πŸ“Œ Project Summary

This project demonstrates an end-to-end Retail Sales Analytics solution by combining:

  • 🐍 Python for Exploratory Data Analysis (EDA)
  • πŸ—„οΈ SQL Server for database design, normalization, ETL, and business analysis
  • πŸ“Š Power BI for interactive dashboard development
  • πŸ“ˆ DAX for KPI calculations
  • πŸ”„ Git & GitHub for version control

Throughout the project, raw retail sales data is transformed into meaningful business insights using industry-standard tools and best practices.

The project highlights essential data analytics skills, including:

  • Data Cleaning
  • Exploratory Data Analysis
  • Database Design
  • Data Normalization
  • SQL Querying
  • Business Analysis
  • Dashboard Development
  • Data Visualization
  • KPI Reporting
  • Business Intelligence

This repository serves as a practical demonstration of the complete analytics workflowβ€”from raw data to executive reportingβ€”and reflects real-world techniques commonly used by Data Analysts and Business Intelligence professionals.


Thank you for visiting this repository!

If you enjoyed this project or found it useful, don't forget to ⭐ the repository.

Happy Learning! πŸš€

About

End-to-end Retail Sales Analytics project using Python, SQL Server, and Power BI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages