Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Product Line Profitability & Margin Performance Analysis

Project Overview

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.


Problem Statement

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.


Project Objectives

  • 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

Dataset

The dataset contains 10,194 records and 18 columns related to sales, products, customers, shipping, costs, and profitability.

Important Features

  • Order Date
  • Ship Date
  • Ship Mode
  • Country/Region
  • City
  • State/Province
  • Division
  • Region
  • Product Name
  • Sales
  • Units
  • Gross Profit
  • Cost

Project Methodology

1. Data Loading & Exploration

  • Loaded the dataset using Pandas
  • Examined the dataset structure and data types
  • Checked missing values and duplicate records
  • Analyzed numerical and categorical variables

2. Data Cleaning & Preprocessing

  • 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

3. Exploratory Data Analysis

Performed analysis of:

  • Product-level profitability
  • Division-level performance
  • Sales versus profit relationships
  • Cost and margin relationships
  • Profit concentration

4. Feature Engineering

Created important business metrics including:

  • Gross Margin (%)
  • Profit per Unit
  • Revenue Contribution (%)
  • Profit Contribution (%)
  • Cumulative Profit (%)
  • Cost Pressure (%)
  • Shipping Lead Time

5. Machine Learning

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

6. Model Evaluation

Models were evaluated using:

  • Mean Absolute Error (MAE)
  • Root Mean Squared Error (RMSE)
  • R² Score

7. Factory Reallocation Simulation

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.

8. Recommendation System

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

Key Business Insights

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.


Power BI Dashboard

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

Power BI Dashboard


Project Structure

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

About

End-to-end product profitability and margin analysis using Python, machine learning, and Power BI to identify high-value products, margin risks, and business opportunities.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages