Joyce King Portfolio

Retail Sales Performance Analysis Using SQL & Power BI

30 May 2026

Overview

This project analyses retail sales data to uncover key business insights around revenue, product performance, and regional trends. The goal was to simulate a real-world business reporting system that helps stakeholders make data-driven decisions.

Business Problem

Retail businesses generate large volumes of transaction data but often struggle to convert that data into actionable insignts. This project demonstrates how sales data can be transformed into meaningful information for decision-making.

The business needed answers to:

  • Which products generate the highest revenue?
  • Which regions are underperforming?
  • How do sales trends change over time?
  • What factors drive revenue growth or decline?

Tools Used

  • SQL (MySQL) for data extraction and transformation
  • Power BI for dashboard development and visualisation
  • Excel for initial data creation and validation
  • GitHub Pages for project documentation and portfolio presentation

Dataset Download

You can download the full dataset used in this project below:

Download Energy_Dataset.csv

The dataset contains 100 sales transactions and includes:

  • Order ID
  • Order Date
  • Customer ID
  • Product
  • Category
  • Region
  • Quantity
  • Unit Price
  • Payment Method

Please note all result outputs have been converted to CSV files


Analysis Performed

  • Total revenue calculation
select
    round(sum(quantity * unit_price), 2) revenue
    from sales_data;

View Output Here

This answers the question of total revenue from the earliest date to latest.


  • Revenue by region
select
    region,
    round(sum(quantity * unit_price), 2) revenue
from sales_data
group by region
order by revenue desc;

View Output Here

The region that generates the most revenue is seen to be East, and the regions that are underperforming are South and Central.


  • Revenue by product category
select
    category,
    round(sum(quantity * unit_price), 2) revenue
from sales_data
group by category
order by revenue desc;

View Output Here

From the results we can see that Fuel contributes the most to the total revenue.

Although it generates the most revenue, fuel itself has very low margins.

Therefore fuel was the highest-performing category, generating $1,073,467.12 in revenue and contributing 31.74% of total revenue during the analysis period. This performance appears to be driven primarily by high sales volume rather than premium pricing.


Product Performance

  • Top-selling products by revenue
select
    product,
    round(sum(quantity * unit_price), 2) revenue
    from sales_data
    group by product
    oder by revenue desc
    limit 10;

View Output Here

Product Performance Analysis

Analysis of product-level revenue revealed that Lubricant Oil was the highest performing individual product, generating $607,889.95 in revenue, followed by Inverter Battery ($552,094.45) and LPG Cylinder Refill ($493,999.91).

While the fuel category contributed the largest share of overall revenue (31.74% of total revenue), a deeper product-level analysis showed that no single fuel product was the top revenue generator. Instead, the category’s strong performance was driven by the combined sales of multiple fuel products, including Kerosene, Diesel, and Petrol.

This distinction is important because it suggests that the fuel category’s success is primarily volume-driven and diversified across several products, rather than dependent on a single high-performing item.

Management should continue monitoring demand across the fuel category due to its signnificant revenue contribution. However, special attention should be given to Lubricant oil, which demonstrated the strongest individual product performance and may offer opportunities for increased revenue through focused promotional campaigns and inventory planning.


  • Top-selling products by quantity
select
    product,
    sum(quantity) units_sold
from sales_data
group by product
order by units_sold desc
limit 10;

View Output Here

Comparing the result of Revenue rank vs Quantity sold rank

Product Revenue Rank Quantity Sold Rank
Lubricant oil 1 3
Inverter Battery 2 1
LPG Cylinder Refill 3 2
Kerosene 4 5
Diesel 5 4

To get revenue per unit sold, the query was used:

select
    product,
    round(sum(quantity * unit_price) / sum(quantity), 2) revenue_per_unit
from sales_data
group by product
order by revenue_per_unit desc;

View Output Here

Product performance varied significantly depending on the metric used. Inverter batteries recorded the highest sales volume (878 units), indicating strong customer demand. Lubricant oil generated the highest total revenue ($607,889.95), demonstrating the strongest overall financial contribution.

Meanwhile, Industrial gas produced the highest revenue per unit ($767.36), suggesting a premium-value product with lower sales volume.

These findings highlight the importance of evaluating product performance through multiple dimensions rather than relying on a single metric.


Time Analysis

  • Monthly sales trends
select
    date_format(order_date, '%y-%m') month,
    round(sum(quantity * unit_price), 2) revenue
from sales_data
group by month
order by month;

View Output Here

First observation: Revenue increased during the year

The beginning of the year was weak:

  1. January: $170,617.73
  2. February: $294,896.21
  3. March: $300,213.64

Revenue trended upwards throughout the year, with stronger performance observed during the second half of the reporting period.

Second observation: August and November were peak months

  1. November: $452,688.98
  2. August: $422,461.58

Sales peaked in November, generating $452,688.98 in revenue, followed by August with $422,461.58. These months significantly outperformed the annual average.

The query was used to generate average monthly revenue:

select
    round(avg(monthly_revenue),2) avg_monthly_revenue
from (
    select
        date_format(order_date, '%y-%m') month,
        sum(quantity * unit_price) monthly_revenue
    from sales_data
    group by month
) t;

View Output Here

The business generated an avergae monthly revenue of $281,872.39 during the analysis period.

November was the strongest performing month, generating $452,688.98, which was approximately 60.6% above the monthly average.


Power BI Dashboard