Your ERP knows the cost of every product sold. It tracks which product families contribute to gross margin and by how much. But there is one question that most mid-market companies cannot answer with their current ERP data: what is the true P&L per customer, once all direct costs have been allocated?
The difference between a customer who generates £2.5M in revenue and genuinely contributes to your bottom line and another who generates £3.5M but actually destroys £250,000 of net margin can come down to a few parameters invisible in standard reporting: special logistics costs, extended payment terms, disproportionate after-sales service, cumulative discounts, and recurring credit notes. Without the customer analytics dimension properly configured in your ERP, this reality stays hidden in averages.
This guide details the methodology for building true customer profitability tracking in your ERP, the KPIs to monitor, the pitfalls to avoid, and the implementation specifics across the major ERP platforms.
Product Margin vs. Customer Margin: Two Complementary Perspectives
Why Product Margin Only Tells Half the Story
Margin by product line answers a specific question: which product families should you grow, rationalise, or discontinue? It is an excellent portfolio management tool, but it tells you nothing about the profitability of your commercial relationship with a given customer.
Two customers can buy exactly the same product mix, under identical pricing conditions, and generate radically different profitability levels for your business. The reason: service costs are not distributed uniformly. Some customers demand special packaging, short lead times with dedicated delivery runs, a dedicated account manager, frequent returns, and payment terms negotiated at 90 days. Others order on a regular cadence, pay in 30 days, and consume almost no after-sales resources.
Gross margin by product line is the first level of analysis. Customer margin is the second level, answering a different strategic question: with whom do we want to build revenue?
The Hidden Costs Per Customer That Erode Profitability
Several cost categories never surface in standard reporting because they are booked by cost centre or by nature, without being allocated to the customer who generated them:
- Special logistics: express deliveries, dedicated routes, bespoke palletisation.
- After-sales and disputes: time spent by the customer service team on complaints, cost of replacements and returns.
- Commercial time: visits, inbound calls, drafting complex proposals. An account manager who spends 40% of their time on a single customer represents a significant cost that no P&L attributes to that customer.
- Payment terms: a customer who pays in 90 days instead of 30 creates a real financial cost through their impact on working capital, which a short-term financing rate can quantify.
- Cumulative discounts and credit notes: year-end rebates, return credits, and one-off commercial gestures frequently accumulate without their net impact on margin being recalculated in real time.
The Whale Curve: What the Data Actually Shows
Academic research on customer profitability provides a solid reference framework. Professors Robert Kaplan and V.G. Narayanan (Harvard Business School) formalised what they call the “whale curve”: when you plot the cumulative contribution of customers ranked from most to least profitable, the curve rises above 100% before coming back down.
Their research shows that the top 20% most profitable customers typically generate between 150 and 300% of total company profits. The next 60–70% break even. The least profitable 10–20% destroy between 50 and 200% of profits (Customer Profitability Analysis, Wikipedia, reference Kaplan & Narayanan).
The operational conclusion of this model is not to eliminate unprofitable customers, but to understand the drivers of that unprofitability in order to address them: renegotiate terms, reduce service costs, or reframe the commercial relationship.
Building a Customer P&L in Your ERP
Customer Analytics Dimensions in the ERP: Upstream Configuration
Before generating any customer profitability report, the ERP must be able to allocate revenues and costs to a “customer” dimension. This requires defining the analytical structure upfront in the project.
The minimum analytical dimensions for a customer profitability analysis are:
- Customer dimension: the customer as a third-party accounting entity (vendor/customer code in the ERP).
- Segment dimension: grouping customers by commercial segment (large accounts, distributors, resellers, export…).
- Channel dimension: distribution channel (direct, indirect, e-commerce, marketplaces).
This three-level structure allows you to aggregate data at the desired granularity: individual customer analysis for annual negotiations, or segment analysis for strategic decisions.
Direct and Indirect Costs: Choosing the Right Allocation Keys
Not all costs can be allocated directly to a customer. Two categories must be distinguished.
Direct costs can be allocated without ambiguity: cost of goods delivered, freight costs specific to the order, commercial commission tied to the account, cost of returns recorded against that customer.
Indirect costs require an allocation key. Several approaches are available:
- Revenue proration: simple but reductive. It over-allocates costs to large customers and under-allocates to small high-service customers.
- Number of orders: relevant for order-to-cash processing costs.
- Number of after-sales interventions: relevant for customer support costs.
- Activity-Based Costing (ABC): the most accurate but also the most demanding to configure. It allocates costs to activities (delivery, invoicing, support), then charges those activities to customers according to their actual consumption.
ABC is difficult to implement fully in a mid-market ERP without complementary BI tooling. A hybrid approach is often more realistic: direct costs via direct allocation, indirect costs using two or three allocation keys by cost type.
Discounts, Year-End Rebates, and Credit Notes: Avoiding Double-Counting
One of the main sources of error in a customer P&L is the treatment of discounts and credit notes. Several pitfalls are common.
Year-end rebates are often provisioned monthly, but the provision is not always allocated to the relevant customer. The result: the customer’s monthly margin looks correct, but the actual annual margin is different once the rebate is settled.
Return credit notes must be deducted from net revenue, not treated as a separate charge. Otherwise, the gross margin rate is overstated.
Ad-hoc commercial gestures (discretionary rebates, prompt payment discounts granted outside contract) must be captured in the same customer analytical account to avoid disappearing into general overheads.
Correct configuration of these flows in the ERP is a prerequisite for customer profitability reports to be usable.
Key KPIs for Tracking Customer Profitability
The Three Levels of Gross Margin per Customer
The most widely used management accounting methodology for structuring customer profitability works across three margin levels:
GM1, Commercial Gross Margin: net revenue (after immediate discounts) minus the purchase or production cost of goods and services delivered. This is the baseline level, generally available in the ERP without advanced configuration.
GM2, Margin After Direct Logistics Costs: GM1 minus the transport, handling, and storage costs specific to that customer. This is the level at which customers requiring express delivery or bespoke packaging diverge from “standard” customers.
GM3, Margin After Customer Service Costs: GM2 minus direct service costs (after-sales, disputes, returns, dedicated commercial time). This is the level that reveals the true profitability of the relationship, independent of volume.
The objective is not necessarily to reach GM3 for every customer from day one. GM1 alone is already progress if the company has no existing customer analytics structure. Implementation can be phased over 12 to 24 months.
Customer Service Cost (CSC): The True Cost to Serve
Customer Service Cost refers to all resources consumed to manage the relationship with a customer: time from the sales team, order management, after-sales, logistics, and credit control. It is expressed in monetary terms and can be expressed as a percentage of the customer’s revenue to yield a service rate.
A CSC above 8–10% of customer revenue is a warning signal in B2B distribution. Some customers with a CSC of 15–20% appear profitable on GM1 alone, but are actually loss-making once service costs are accounted for.
DSO by Customer and the Working Capital Financing Cost
Days Sales Outstanding (DSO) measures a customer’s average payment delay, expressed in days. A customer who pays in 90 days rather than 30 generates an additional financial cost corresponding to 60 days of tied-up revenue.
For a customer generating £4M in annual revenue, 60 days of excess outstanding represents approximately £657,000 of tied-up cash. At current short-term financing rates (between 3.5% and 5% for mid-market companies in 2026), this corresponds to an annual financial cost of £23,000–£33,000, invisible in standard gross margin but very real.
Integrating DSO per customer into the profitability analysis allows you to calculate a “financial margin” that includes this cost of customer capital. This is particularly relevant in a high-interest-rate environment.
Customer Lifetime Value (CLV): Adding the Time Dimension
CLV estimates the total economic value a customer is likely to generate over the duration of the commercial relationship. It incorporates the historical retention rate, average observed margin, and projection horizon.
CLV is not a calculation that belongs in the ERP — it is generally produced by the CRM or an analytics tool. But it is useful for contextualising decisions made on the basis of the customer P&L. A customer whose GM3 is slightly negative this year but who has a positive CLV and growth potential deserves a different approach from a customer who has been structurally loss-making for three years.
Implementation in the Major ERP Platforms
SAP S/4HANA: Profitability Analysis (CO-PA)
SAP S/4HANA offers the CO-PA module (Controlling-Profitability Analysis), which enables multidimensional profitability analysis. Characteristics (analysis dimensions) include customer, product, sales region, channel, and strategic segment.
In S/4HANA, CO-PA can be configured as costing-based (value analysis, more flexible for management reporting) or account-based (aligned with general ledger, recommended for consistency with financial statements).
For a complete customer profitability analysis, key configuration involves: defining the operating concern with the customer as a characteristic, assigning pricing conditions (discounts, surcharges) to the correct CO-PA values, and configuring allocation keys for indirect costs. Dynamic visualisation typically requires SAP Analytics Cloud or a third-party BI tool for ad-hoc reporting.
Microsoft Dynamics 365: Customer Profitability Analysis
Microsoft Dynamics 365 Finance enables customer profitability analysis via management accounting (financial dimensions). By combining customer and cost centre dimensions, it is possible to produce profit and loss statements by customer.
The key advantage of Dynamics 365 is its native integration with Power BI: customer margin data can be visualised in dynamic dashboards, with drill-throughs down to transaction level. For companies already in the Microsoft ecosystem (Teams, Azure, Microsoft 365), this simplifies deployment of the reporting layer.
Odoo: Multi-Axis Analytical Accounting
Odoo offers multi-axis analytical accounting (analytic plans) that allows revenues and costs to be allocated to analytic accounts organised in a hierarchy. A “Customers” analytic plan can be created with one account per customer or per segment.
One of Odoo’s advantages is the ease of configuring automatic allocation rules: a delivery linked to a customer can automatically post its transport costs to the customer’s analytic account, without manual entry. The limitation is granularity: for very detailed analysis across multiple cross-referenced dimensions, Odoo’s native reports reach their limits and require export to an external analytics tool.
Sage X3: Multi-Axis Analytical Structure
Sage X3 supports an analytical structure with multiple configurable axes (customer, product, channel, project, profit centre). The strength of Sage X3 is configuration flexibility: the number of axes and their hierarchy can be set by the implementation partner according to the company’s management model.
For a B2B distribution mid-market company, the combination of “customer × product range × channel” axes enables cross-dimensional analyses that address both the CFO’s questions (customer P&L) and the commercial director’s questions (profitability by distribution channel).
As with other ERP platforms, dynamic visualisation and ad-hoc analysis typically require a dedicated BI tool (Sage BI Reporting, Power BI, or Tableau) to go beyond standard reports.
Pitfalls to Avoid in Implementation
The Single Revenue-Based Allocation Key
This is the most frequent and most misleading mistake. Allocating all indirect costs in proportion to revenue amounts to assuming that every pound of sales consumes the same quantity of resources. In reality, a customer who represents 5% of revenue but 25% of after-sales calls and 30% of returns generates a service cost completely disconnected from their revenue share.
In practice, this allocation key penalises large standard customers and masks service inefficiencies on small, demanding customers. It can lead to inverted commercial decisions: tightening conditions for customers who genuinely contribute to margin, while maintaining unprofitable relationships with customers who absorb disproportionate resources.
The Large Customer Paradox
Customer profitability data often reveals an uncomfortable paradox: the largest customers are not necessarily the most profitable. A customer generating £8M in revenue who benefits from very favourable pricing conditions (negotiated over time), who imposes strict delivery deadlines, who generates a high volume of after-sales activity, and who pays in 75 days can have a lower GM3 than a customer generating £1.5M on a regular cadence, with no special demands, paying in 30 days.
This kind of conclusion creates tension with sales teams who have built their reputation on these major accounts. The challenge is not to exit those relationships, but to have objective data to renegotiate terms or target service improvement efforts on the segments where the margin impact will be greatest.
Commercial Resistance: The Human and Political Dimension
Implementing a customer profitability analysis is often perceived by the sales force as a control tool or a challenge to their work. If communication around the project amounts to “we’re going to measure the profitability of your customers”, adoption will be difficult.
The approach that works is to position the tool as a commercial negotiation lever: having the customer P&L available enables better arguments for a price increase, identifies which terms to renegotiate, and prioritises customer relationship investments. It is a commercial advantage, not an audit.
It is essential to involve commercial managers in defining the calculation rules and validating the first results. A customer P&L that the commercial leadership does not understand or believe in will never be used.
Six-Month Deployment Plan
A customer profitability analysis project in the ERP typically unfolds across four phases.
Month 1, Existing Analytical Dimensions Audit: review of the current analytical structure in the ERP, identification of available data by customer (revenue, purchase cost, discounts, credit notes), assessment of missing data (logistics costs, after-sales time).
Month 2, Mapping Allocatable Costs: joint work between management control and operations to list costs that can be allocated by customer, selection of allocation keys by cost type, validation with the commercial director and CFO.
Months 3–4, Configuration and Pilot Testing on 10 Customers: configuration of analytical dimensions in the ERP, implementation of automatic allocation rules, P&L calculation on a panel of 10 representative customers (large accounts, mid-size accounts, known problem accounts), validation of results by management controllers.
Months 5–6, Training and Go-Live: training for management controllers and CFOs on report interpretation, communication to commercial managers, phased rollout across the full customer portfolio, first quarterly customer profitability review.
The first cycle typically reveals surprises: customers considered secondary who are in fact highly contributive, and supposedly strategic accounts whose actual profitability is lower than estimated. These surprises are precisely the value of the exercise.
To deepen the analytical prerequisites for this project, read our guide on ERP management control and analytical accounting and our article on rolling forecast and zero-based budgeting in the ERP to integrate this analysis into your financial planning cycle.