One of the most commonly used types of dashboards is a sales dashboard.
If you’re a sales manager, you definitely want a tool that gives you a real-time overview of the most important sales information that you need to reach your goals.
Here is the dataset used – the retail data of a global superstore.
The dashboard displays your KPIs including sales, profit, the average order size, on-time delivery rate, and the number of new customers.
You may also see your top customers.
And there is revenue QTD and YTD by region.
The dashboard also shows product sales by product categories, and you may check the number of units sold as well as the average unit price.
To build this dashboard we have used just one data source, but you are free to use as many as you need.
The data is fetched from the database with SQL queries.
Here are a couple of cool queries as an example:
To calculate the actual new customers I used:
WITH t AS ( SELECT DISTINCT customer_id, order_date, MIN(order_date) OVER (PARTITION BY customer_id) AS first_purchase_date, date_part('month', order_date) AS the_month FROM superstore_orders ) SELECT COUNT(first_purchase_date) FROM t WHERE first_purchase_date > '2014-01-01'
And to calculate the on-time delivery rate I used:
WITH t AS ( SELECT *, DATE_PART('day', ship_date::timestamp - order_date::timestamp) AS days, ( CASE WHEN ship_mode = 'Same Day' THEN 0 WHEN ship_mode = 'First Class' THEN 2 WHEN ship_mode = 'Second Class' THEN 4 WHEN ship_mode = 'Standard Class' THEN 7 ELSE NULL END ) AS ship_mode_days FROM superstore_orders WHERE DATE_PART('year', order_date) = 2014 ), t2 AS ( SELECT *, (CASE WHEN ship_mode_days - days >= 0 THEN 1 ELSE 0 END) AS ontime FROM t ), t3 AS ( SELECT (SELECT COUNT(*) FROM t2) AS count_all, (SELECT COUNT(*) FROM t2 WHERE ontime = 0) AS count_0, (SELECT COUNT(*) FROM t2 WHERE ontime = 1) AS count_1 ) SELECT *, ROUND((count_0::float / count_all) * 100) as count_0_pc, ROUND((count_1::float / count_all) * 100) as count_1_pc FROM t3
Comment below what else you would add to your sales dashboard.