In this project, I used an SQL Dump found on GitHub, which contains data about an India-based company’s customers, markets, products, and transactions.
This project’s objective was to create a dashboard that would allow managers in the company to gain insights into sales performance and make decisions based on that, where the end goal is increasing sales.
Before beginning, defining the metrics and KPIs is crucial to getting the most out of the data in hand, so the questions we need to answer are:
- What’s the company’s revenue growth over time?
- What’s the revenue from each specific client?
- How many sales were made in each year/month?
- How many sales were made by a specific client?
- Who are the top customers?
- Which products are bestsellers?
- What markets bring in the most revenue?
- What markets have the biggest sales quantity?
- What percentage of sales were made online?
The dashboard will help answer the questions above, shedding light on areas of improvement to increase sales.
-
Show all customer records
SELECT * FROM customers;
-
Show total number of customers
SELECT count(*) FROM customers;
-
Show transactions for Chennai market (market code for chennai is Mark001
SELECT * FROM transactions where market_code='Mark001';
-
Show distrinct product codes that were sold in chennai
SELECT distinct product_code FROM transactions where market_code='Mark001';
-
Show transactions where currency is US dollars
SELECT * from transactions where currency="USD"
-
Show transactions in 2020 join by date table
SELECT transactions.*, date.* FROM transactions INNER JOIN date ON transactions.order_date=date.date where date.year=2020;
-
Show total revenue in year 2020 in Chennai
SELECT SUM(transactions.sales_amount) FROM transactions INNER JOIN date ON transactions.order_date=date.date where date.year=2020 and transactions.market_code="Mark001";
1. Formula to remove -1 and 0 values from sales_amount column - in sales_transactions table
= Table.SelectRows(sales_transactions, each ([sales_amount] <> -1 and [sales_amount] <> 0))
- Formula to create norm_sales_amount column (currency inversion from INR to USD) - in sales_transactions table
= Table.AddColumn(#"Cleanup currency", "Norm_sales_amount", each if [currency] = "INR" then Number.Round([sales_amount]*0.012309894,2) else [sales_amount])
- Formula to remove duplicates - in sales_transactions table
= Table.SelectRows(#"remove -1/0 from sales amount", each ([currency] = "INR#(cr)" or [currency] = "USD#(cr)"))
- Formula to remove NULL zones - in sales_markets table
= Table.SelectRows(sales_markets, each ([zone] <> ""))