###DashBoard Links= https://srmistedu-my.sharepoint.com/:u:/g/personal/20211008996_srmistedu_onmicrosoft_com/EYgGquuu6QJMsJtQSVrqbn0B66BBVxe31Uvtz3fdGJstpQ?e=rbLtaj
##Steps to be followed Step 1:Load the data to the PowerBI using get data in PowerBI application.Click on the database option and then select MySql,enter the server and database in the popup section.The data will be loaded. step 2: Now,click on the 'transform data'section,it will take you to the power query editor. Step 3: Analyze and clean the data and then load it to the PowerBI by clicking on the 'file' section. step 4: Create the DashBoard that represent the revenue trends and help the company to deal with the revenue decrement or increment.
-
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)
####Data Analysis Using SQL
-
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)