Data for the project was provided by codebasics.
#Language/Platform/Libraries MySQL Workbench PowerBI
##Problem Statement
Data Analysis Using MySQL Data Cleaning in PowerBi Build PowerBi Dashboard Dashboard Improvement
The sales are declining for the company AtliQ Hardware. The Sales Director is meeting up the regional managers to figure out what the issue is. The Regional Managers are not being direct with the status of their sales and provid the sales director with multiple excel sheets of sales data. The Sales Director has assigned the task to use the excel sheets provided by the Regional Managers to create an interatice dashboard in Tableau with the year to date revenue, top customers and weakest regions. The stakeholders are the Sales Director, Marketing Team, Customer Service Team, Data and Analytics Team and IT.
Data Cleaning, Analysis and Visualization
Results
what are the two weakest regions what are my top 5 customers and sales quantity revenue breakdown by cities revenue breakdown by years and moths (year to date revenue) top 5 products by revenue number
-
Follow step in this video to install mysql on your local computer https://www.youtube.com/watch?v=WuBcTJnIuzo
-
SQL database dump is in db_dump.sql file above. Download
db_dump.sql
file to your local computer and import it as per instructions given in the tutorial video
-
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,
SELECT SUM(transactions.sales_amount) FROM transactions INNER JOIN date ON transactions.order_date=date.date where date.year=2020 and transactions.currency="INR\r" or transactions.currency="USD\r";
-
Show total revenue in year 2020, January Month,
SELECT SUM(transactions.sales_amount) FROM transactions INNER JOIN date ON transactions.order_date=date.date where date.year=2020 and and date.month_name="January" and (transactions.currency="INR\r" or transactions.currency="USD\r");
-
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";
- Formula to create norm_amount column
= Table.AddColumn(#"Filtered Rows", "norm_amount", each if [currency] = "USD" or [currency] ="USD#(cr)" then [sales_amount]*75 else [sales_amount], type any)