This project analyzes online retail sales to provide insights into product performance and customer behavior. Key metrics, monthly / Year, trends, top products, and top customers are displayed through Power Bi dashboars. SQL queries were also created to replicate the calculations and support data-driven decision making.
Online Retail
| Column | Data type | Description |
|---|---|---|
InvoiceNo | VARCHAR | Calculated revenue for each transaction. |
StockCode | DATE | Product code. |
Description | TEXT | Product description. |
Quantity | INT | Number of units sold. |
InvoiceDate | DATETIME | Date and time of the invoice. |
UnitPrice | FLOAT | Price per unit of the product. |
CustomerID | VARCHAR | Unique customer identifier. |
Country | VARCHAR | Country of the customer. |
TotalRevenue | FLOAT | Calculated revenue for each transaction. |
Page 1 - Month / Year Trend - Revenue & Orders
Shows key sales metrics: total revenue, total orders, average order value, and active customers. Queries calculate these metrics, while the line chart displays monthly revenue and orders, and the map shows revenue and orders by country.
-- Shows total_revenue, orders, average order value and active customers.
SELECT SUM(Quantity * UnitPrice) AS total_revenue,
COUNT(DISTINCT InvoiceNo) AS Orders,
SUM(Quantity * UnitPrice) / COUNT(DISTINCT InvoiceNo) AS avg_order_value,
COUNT(DISTINCT CustomerID) AS active_customers
FROM 'online_retail.csv'-- Revenue and orders trend by year and month.
SELECT
CONCAT_WS('-', SUBSTR(InvoiceDate, 7, 4),
SUBSTR(InvoiceDate, 4, 2)) AS year_month,
SUM(Quantity * UnitPrice) AS total_revenue,
COUNT(DISTINCT InvoiceNo) AS total_orders
FROM online_retail.csv
GROUP BY year_month
ORDER BY year_month;-- Revenue and orders by country.
SELECT Country,
SUM(Quantity * UnitPrice) AS total_revenue,
COUNT(DISTINCT InvoiceNo) AS orders,
FROM online_retail.csv
GROUP BY Country
ORDER BY total_revenue DESC;Page 1 - Month / Year Trend – Revenue & Orders
Page 2 - Products & Top Sales
Shows a product table with StockCode, Description, Total Quantity, and Total Revenue, followed by bar charts highlighting top products by total revenue and quantity sold.
-- Product details table showing StockCode, Description, Total Quantity, and Total Revenue.
SELECT StockCode,
Description,
SUM(Quantity) AS total_quantity,
SUM(Quantity * UnitPrice) AS total_revenue
FROM online_retail.csv
GROUP BY StockCode, Description
ORDER BY total_quantity DESC;-- Top Products by Total Revenue
SELECT Description,
SUM(Quantity * UnitPrice) AS total_revenue,
SUM(Quantity) AS total_quantity
FROM online_retail.csv
GROUP BY Description
ORDER BY total_revenue DESC
LIMIT 10;-- Top Products by Total Quantity sold
SELECT Description,
SUM(Quantity) AS total_quantity,
SUM(Quantity * UnitPrice) AS total_revenue
FROM online_retail.csv
GROUP BY Description
ORDER BY total_quantity DESC
LIMIT 10;Page 2 - Products & Top Sales