- SQL database dump is in db_dump.sql file above. Download db_dump.sql file to your local computer and import it.
-
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 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 JOIN date ON transactions.order_date=date.date where date.year=2020 and transactions.currency="INR" or transactions.currency="USD";
-
Show total revenue in year 2020, January Month,
SELECT SUM(transactions.sales_amount) FROM transactions JOIN date ON transactions.order_date=date.date where date.year=2020 and and date.month_name="January" and (transactions.currency="INR" or transactions.currency="USD");
-
Show total revenue in year 2020 in Chennai
SELECT SUM(transactions.sales_amount) FROM transactions JOIN date ON transactions.order_date=date.date where date.year=2020 and transactions.market_code="Mark001";
- Sales Overview: This dashboard provides a high-level overview of sales performance, including total sales, sales by region, and sales by product.
- Sales Trend: This dashboard shows the trend of sales over time.
- Top Customers: This dashboard shows the top 5 customers by total sales.
= Table.AddColumn(sales_transactions, "sales_amount_normlized", each if [currency] = "USD" then [sales_amount]*75 else [sales_amount])
- as you can see we dive deep into 2020 year to see the trend and all other profit analysis
- it provides other dimensions analysis for the Revenue by showing the % of each region's customer and market besides the % of Profit Contribution from the Total Profit
Revenue Contribution % = DIVIDE([Revenue],CALCULATE([Revenue],ALL('sales products'),ALL('sales customers'),ALL('sales markets')))
Profit Margin Contribution % = DIVIDE([Total profit Margin],CALCULATE([Total profit Margin],ALL('sales products'),ALL('sales customers'),ALL('sales markets')))
Profit Margin % = DIVIDE([Total profit Margin],[Revenue],0)
- as you can see we analyze the performance of 2020 to see the difference between this year and the last one through a combo chart
- More important is identifying every market in which region contributes to our lose in profit
Revenue LY = CALCULATE([Revenue],SAMEPERIODLASTYEAR('sales date'[date]))
Profit Target = GENERATESERIES(-0.05, 0.15, 0.01)
Profit Target Value = SELECTEDVALUE('Profit Target'[Profit Target])
Target Diff = [Profit Margin %] - 'Profit Target'[Profit Target Value]