Gross Margin Analysis by Product and Customer
Gross margin analysis by product and customer is the practice of measuring profitability at the transaction line level, then aggregating it along the dimensions that drive decisions: item, product family, customer, channel, and plant. Most manufacturers report gross margin only in total, which averages away the detail that matters. When line-level analysis is done properly, a familiar pattern appears: roughly 20 to 30 percent of SKUs and 10 to 20 percent of customers generate margin at or below zero once freight, rebates, and cost-to-serve are attributed. Those items are usually invisible in a consolidated P&L.
Building a Line-Level Margin Model From ERP Data
The foundation is the invoice or shipment line, joined to the item cost that applied on the transaction date. That date sensitivity matters: pulling today's standard cost against last year's invoices produces margin history that quietly rewrites itself every time you re-roll costs. Capture cost of goods sold as it was posted, broken into material, labor, overhead, and outside processing so you can see which component is moving. In SyteLine that detail lives in the customer order line and its associated cost fields, in LN the sales invoice line carries cost components, and in M3 the customer order line and accounting transactions carry the equivalent split. Store the result in a reporting layer, because running this analysis directly against production transaction tables at scale is a performance trap.
Allocating Freight, Rebates, and Cost-to-Serve
Gross margin at the invoice line is only the starting point. The costs that turn an apparently healthy 32 percent margin into a losing account almost always sit below the line: outbound freight on small orders, customer rebate programs accrued at year end, expedite and premium freight charges, restocking and returns, and consigned inventory carrying cost. Attributing these back to customer and item converts gross margin into contribution margin, which is the number that should drive pricing conversations. The allocation does not need to be perfect to be useful; a defensible driver applied consistently beats an exact number produced once a year.
- Allocate outbound freight by actual shipment weight or carrier invoice, not as a flat percent of revenue
- Accrue customer rebates monthly against earned volume so margin is not restated in December
- Charge premium and expedite freight back to the order line that caused it, including internal expedites
- Add a cost-to-serve factor for order frequency, line count, and returns rate on high-touch accounts
Price, Volume, and Mix: Explaining Margin Movement
When margin drops two points quarter over quarter, executives want to know which of three forces caused it. A price-volume-mix bridge separates them: price effect is the change in realized price at constant volume and mix, volume effect is the change in units at constant price and margin rate, and mix effect is the shift between higher and lower margin products or customers. Mix is the one most often blamed and least often measured, and in multi-plant manufacturers it frequently dominates. Build the bridge monthly from the same line-level dataset that feeds the margin model, and reconcile it to the reported gross margin change so nobody debates the arithmetic during the review.
Turning Margin Analysis Into Pricing Action
Analysis that never changes a price is overhead. The operational output of a margin review should be a short, specific action list: items to reprice, customers to renegotiate at contract renewal, minimum order quantities or freight minimums to introduce, and SKUs to rationalize. In practice a 3 percent price increase applied only to the bottom-quartile margin lines usually delivers more profit than a broad 1 percent increase, with far less customer disruption. Track realization afterward, because approved price increases erode through discounting and off-invoice concessions at a rate of 20 to 40 percent within two quarters if nobody measures the actual invoiced price.
- Rank every item-customer combination by contribution margin dollars and margin percent, then act on the bottom quartile
- Set freight minimums and minimum order quantities where small-order freight consumes the entire margin
- Review discount authority: track approved price versus actually invoiced price by salesperson each month
- Rationalize SKUs with negative contribution and under 12 orders per year unless a strategic account requires them
How Netray Margin Agents Surface Profit Leaks
Netray margin agents build the line-level contribution model from your ERP transaction history, attribute freight and rebate costs using the drivers you approve, and then monitor it continuously instead of quarterly. The agents flag margin erosion at the item-customer level as soon as it exceeds a threshold you set, produce the price-volume-mix bridge automatically each month, and identify quotes being priced off stale standard costs before they are sent. On a typical mid-market manufacturer with 5,000 SKUs and 800 customers, the first analysis usually identifies 1.5 to 3 points of recoverable gross margin, most of it concentrated in small-order freight and unmanaged discounting.
Frequently Asked Questions
How do you calculate gross margin by customer in ERP?
Start at the invoice or shipment line, join each line to the cost of goods sold that was posted at the time of the transaction rather than today's standard cost, then aggregate by customer. Add allocated outbound freight, rebates, and returns to convert gross margin into contribution margin. Storing this in a reporting layer rather than querying live transaction tables keeps the analysis fast enough to run monthly across thousands of customers.
What is a good gross margin for a manufacturer?
It varies widely by segment. Contract manufacturers and build-to-print machine shops often run 18 to 28 percent gross margin, while proprietary product manufacturers and aerospace or defense suppliers with engineered content commonly run 30 to 45 percent. The more useful benchmark is internal: the spread between your best and worst quartile of items and customers, because that spread is where recoverable profit sits regardless of where your average lands.
Why does reported gross margin differ from product-level margin?
Reported gross margin includes manufacturing variances, inventory adjustments, obsolescence reserves, and freight that never get pushed down to the item level. Product-level margin usually uses standard cost only. The gap between the two is worth reconciling explicitly each month, because a large unexplained difference means your standards are wrong or your variances are being absorbed somewhere they distort the picture.
Key Takeaways
- 1Building a Line-Level Margin Model From ERP Data: The foundation is the invoice or shipment line, joined to the item cost that applied on the transaction date. That date sensitivity matters: pulling today's standard cost against last year's invoices produces margin history that quietly rewrites itself every time you re-roll costs.
- 2Allocating Freight, Rebates, and Cost-to-Serve: Gross margin at the invoice line is only the starting point. The costs that turn an apparently healthy 32 percent margin into a losing account almost always sit below the line: outbound freight on small orders, customer rebate programs accrued at year end, expedite and premium freight charges, restocking and returns, and consigned inventory carrying cost.
- 3Price, Volume, and Mix: Explaining Margin Movement: When margin drops two points quarter over quarter, executives want to know which of three forces caused it. A price-volume-mix bridge separates them: price effect is the change in realized price at constant volume and mix, volume effect is the change in units at constant price and margin rate, and mix effect is the shift between higher and lower margin products or customers.
Put this into numbers
Free interactive tools for exactly this problem. No signup to use them.
Gross Margin by Product Calculator
Calculate true gross margin for a single product line, including freight and commission, and see the annual gross profit each SKU contributes.
Free ToolMake vs Buy Calculator
Compare in-house production cost against fully landed purchase price, including tooling amortization, and find the volume where making beats buying.
Free ToolStockout Cost Calculator
Price the full annual cost of stockouts across lost margin, expediting, and downstream customer damage, and see what each point of fill rate is worth.
Terms used in this article
Let us build a line-level contribution margin model from your ERP history and show you exactly which SKUs and customers are losing money.
Related Resources
Product Cost Management: Getting the Numbers Right
Product cost management in ERP: standard vs actual costing, cost roll-ups, overhead absorption, and variance analysis that keeps item costs accurate.
ERPBudgeting and Forecasting in ERP
Budgeting and forecasting in ERP: driver-based models, rolling forecasts, budget ledgers, and 13-week cash views for manufacturers who miss their numbers.
ERPWorking Capital Optimization for Manufacturers
Working capital optimization for manufacturers: cut the cash conversion cycle with DSO, DPO, and inventory levers driven from ERP data, not spreadsheets.