This project focuses on preparing, cleaning, and analyzing sales data using SQL and building a real-time, executive-oriented dashboard using Microsoft Power BI. Key business insights are also highlighted.
The original dataset was reviewed in Excel to understand its structure, identify irrelevant columns, and check for data types.
The data was then imported into MySQL, ensuring the correct formats were applied—especially for dates (e.g., %m/%d/%Y
).
All cleaning steps were performed using SQL. The full script is available in the project files.
Steps included:No duplicates were found. If needed:
DELETE FROM sales_data2_copy WHERE row_num > 1;
SET Country = TRIM(Country);
SET Country = 'Canada' WHERE Country LIKE 'Canad';
TRIM(TRAILING '.' FROM Country) WHERE Country LIKE 'Canada%';
No null values were found in the dataset. If any had been present, they would have been addressed using context-appropriate methods such as imputation or row removal. For example, missing product prices could be filled using the average price of the same item in the same store, or across other stores. Similarly, missing categories could be inferred based on similar products.
ALTER TABLE sales_data2 DROP COLUMN row_num;
DELETE FROM sales_data2 WHERE product IS NULL;
Before moving to Power BI, we ran exploratory analysis via SQL. The script calculates key metrics like Total Revenue and Profit:
ALTER TABLE sales_data2 ADD COLUMN Total_Revenue DOUBLE;
UPDATE sales_data2 SET Total_Revenue = (Price_Per_Unit * Quantity_Purchased) - Discount_Applied;
ALTER TABLE sales_data2 ADD COLUMN Profit DOUBLE;
UPDATE sales_data2 SET Profit = Total_Revenue - (Cost_Price * Quantity_Purchased);
The analysis focused on:
Cleaned data was imported into Power BI as .csv or directly from the MySQL database.
New measures created: Total Revenue, Total Profit, Total Discounts Given, and Average Order Revenue.
Additional columns: Month Name, Month Number, Day Name, Day Number — useful for chronological charts and trend lines.
Design principles:
Visuals include:
Further insights can be uncovered using Power BI filters to segment by country, store, or product category.