Skip to content

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

ColumnData typeDescription
InvoiceNoVARCHARCalculated revenue for each transaction.
StockCodeDATEProduct code.
DescriptionTEXTProduct description.
QuantityINTNumber of units sold.
InvoiceDateDATETIMEDate and time of the invoice.
UnitPriceFLOATPrice per unit of the product.
CustomerIDVARCHARUnique customer identifier.
CountryVARCHARCountry of the customer.
TotalRevenueFLOATCalculated 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.

Spinner
DataFrameas
df
variable
-- 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'
Spinner
DataFrameas
df1
variable
-- 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;
Spinner
DataFrameas
df2
variable
-- 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.

Spinner
DataFrameas
df5
variable
-- 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;
Spinner
DataFrameas
df3
variable
-- 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;
Spinner
DataFrameas
df4
variable
-- 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