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.
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.
- π 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
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.
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
| 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 |
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
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/
βββ 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.
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:
- Create the Retail Sales Analytics database
- Configure the database environment
- Create a staging table matching the raw CSV structure
- Prepare the database for data loading
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)
- Populate normalized tables from the staging table
- Maintain primary and foreign key relationships
Perform SQL analysis to answer real-world business questions using joins, aggregations, Common Table Expressions (CTEs), and Window Functions.
The project answers 25 business questions across multiple analytical domains.
- Overall sales performance
- Business size overview
- Sales by category
- Sales by subcategory
- Sales by market
- Sales by region
- Profit by category
- Most profitable products
- Least profitable products
- Top 10 best-selling products
- Highest profit-generating products
- Products performing above average
- Top 3 products in each category
- Top customers by sales
- Top customers by profit
- Customers with the highest number of orders
- Customer contribution to total sales
- Market-wise sales
- Region-wise sales
- Yearly sales trend
- Weekly sales trend
- Running yearly sales
- Year-over-year sales growth
- Sales by shipping mode
- Order priority analysis
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
The SQL database is connected to Power BI to create an interactive executive dashboard for business decision-making.
The dashboard includes:
- π° Total Sales
- π΅ Total Profit
- π¦ Total Orders
- π Total Quantity Sold
- π Profit Margin %
- π·οΈ Average Discount %
Compare total sales across product categories.
Visualize yearly sales performance and identify long-term trends.
Identify the highest revenue-generating products.
Compare sales performance across different markets.
Users can dynamically filter the dashboard using:
- π Year
- π Market
- π₯ Segment
- π¦ Category
All dashboard visuals update automatically based on the selected filters.
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.
git clone https://github.com/harsh8767/Retail-Sales-Analytics.gitcd Retail-Sales-AnalyticsThe 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
Run the SQL scripts in the following order:
01_Create_Database.sql02_Create_Staging_Table.sql03_create_normalized_tables.sql04_populate_normalized_tables.sql05_business_analysis.sql
This will:
- Create the database
- Create the staging table
- Normalize the data
- Populate relational tables
- Execute business analysis queries
Open the Power BI project located in:
dashboard/
βββ RetailSalesAnalytics.pbix
If required, update the SQL Server connection and refresh the data model.
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.
- Total Sales
- Total Profit
- Total Orders
- Total Quantity Sold
- Profit Margin %
- Average Discount %
- π Sales by Category
- π Sales Trend (Yearly)
- ποΈ Top 5 Products by Sales
- π Sales by Market
The project uses the Superstore Sales Dataset, which contains transactional retail sales data across multiple business dimensions.
- 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.
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
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.
Passionate about Data Analytics, Business Intelligence, SQL, Power BI, Python, Machine Learning, and Artificial Intelligence.
GitHub
https://www.linkedin.com/in/harsh-chavan-1646a2257/
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.
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!
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.
If you enjoyed this project or found it useful, don't forget to β the repository.
Happy Learning! π
