This project analyzes product-level profitability and margin performance for Nassau Candy Distributor using Python, data analytics, machine learning, and Power BI.
The project goes beyond analyzing sales volume by identifying which products truly drive profit, which products have strong or weak margins, how profitability varies across divisions, and where cost pressure creates potential margin risk.
The analysis transforms raw business data into actionable insights and recommendations to support data-driven pricing, cost management, and product portfolio decisions.
Nassau Candy Distributor lacks detailed visibility into:
- Which products generate the highest profit
- Which products have the strongest gross margins
- Whether high-sales products are also highly profitable
- How profitability varies across product divisions
- Which products have high cost pressure and margin risk
- How concentrated the company's total profit is among a small number of products
Without this insight, decisions related to pricing, promotions, product portfolio management, and cost reduction may remain reactive rather than data-driven.
- Analyze product-level profitability
- Calculate gross margin and profit per unit
- Identify high-profit and high-margin products
- Compare sales and profitability across divisions
- Analyze profit concentration using Pareto analysis
- Identify cost-heavy and margin-risk products
- Predict shipping lead time using machine learning
- Explore factory reallocation scenarios
- Generate data-driven business recommendations
- Build an interactive Power BI dashboard
The dataset contains 10,194 records and 18 columns related to sales, products, customers, shipping, costs, and profitability.
- Order Date
- Ship Date
- Ship Mode
- Country/Region
- City
- State/Province
- Division
- Region
- Product Name
- Sales
- Units
- Gross Profit
- Cost
- Loaded the dataset using Pandas
- Examined the dataset structure and data types
- Checked missing values and duplicate records
- Analyzed numerical and categorical variables
- Validated sales, cost, units, and profit values
- Converted date columns into datetime format
- Created shipping lead-time features
- Checked for invalid and inconsistent records
- Prepared the data for analysis and machine learning
Performed analysis of:
- Product-level profitability
- Division-level performance
- Sales versus profit relationships
- Cost and margin relationships
- Profit concentration
Created important business metrics including:
- Gross Margin (%)
- Profit per Unit
- Revenue Contribution (%)
- Profit Contribution (%)
- Cumulative Profit (%)
- Cost Pressure (%)
- Shipping Lead Time
Developed machine learning models to predict shipping lead time using product, factory, region, and shipping-related features.
The following models were evaluated:
- Linear Regression
- Random Forest Regressor
- Gradient Boosting Regressor
Models were evaluated using:
- Mean Absolute Error (MAE)
- Root Mean Squared Error (RMSE)
- R² Score
Alternative factory assignments were explored using the trained machine learning model to simulate potential shipping outcomes.
However, the historical dataset contained only one factory assignment per product. Therefore, the factory reallocation results were treated as exploratory scenario analysis rather than definitive operational recommendations.
Products were classified into business recommendation categories based on profitability, margin, sales, and cost pressure:
- Protect and Prioritize
- Growth Opportunity
- Review Pricing Strategy
- Urgent Cost Reduction Review
- Monitor Performance
The analysis identifies:
- Products that are the primary drivers of total profit
- Products with strong margins and high profit contribution
- Products with high sales but relatively lower profitability
- Products with high cost pressure and potential margin risk
- Profit concentration and dependency on a small number of products
The recommendation system converts analytical findings into actionable business decisions.
The interactive Power BI dashboard provides:
- Executive profitability overview
- Product-level profitability analysis
- Division performance comparison
- Cost and margin risk analysis
- Profit concentration analysis
- Product recommendation insights
Nassau-Candy-Profitability-Analysis/
│
├── data/
│ └── nassau_candy.csv
│
├── notebooks/
│ └── analysis1.ipynb
│
├── dashboard/
│ └── Nassau_Candy_Profitability_Dashboard.pbix
│
├── images/
│ └── dashboard_preview.png
│
├── README.md
├── requirements.txt
└── .gitignore
