Net revenue per line
Gross sales less on-invoice discounts, rebate accruals and prompt-payment discounts, all brought down to the invoice line so they belong to a customer.
Power BI How-To / Finance Analysis
A Power BI customer profitability analysis answers which customers make you money once you count what it costs to serve them. It is not the same job as overhead allocation, which spreads rent, IT and finance salaries across products, customers and projects; this is the customer-level P&L. It starts at net revenue after discounts and rebates, subtracts cost of goods sold and freight, then charges each customer for the orders, invoice lines, deliveries, returns and support tickets it creates. The result is a ranked cumulative-profit view and a clear reprice, change-terms or drop decision for the unprofitable tail.
The short version
Gross sales less on-invoice discounts, rebate accruals and prompt-payment discounts, all brought down to the invoice line so they belong to a customer.
Net revenue less cost of goods sold and the freight paid to ship it. This is where most customer reports stop.
Orders, lines picked, deliveries, returns and tickets, each counted per customer and priced at a rate built from the ledger.
Sort customers by profit, plot the cumulative total, and decide for each loss-maker whether to reprice, change terms or let it go.
Customer profitability analysis measures what each customer actually earns you after everything they cost. In Power BI that means a customer-level P&L: net revenue after discounts and rebates, less cost of goods sold, less freight, returns and the activity cost of serving them, ranked so the profitable core and the loss-making tail are obvious.
Gross margin by customer, the report most ERP and accounting systems offer, stops at product cost. It misses that two customers with identical margin can create very different amounts of work. One sends a full-pallet order each month; the other phones in small orders several times a week, wants them delivered next day and sends a share of them back. That work shows up in warehouse wages, delivery cost and support time, all of which sit in the ledger with no customer attached. Customer profitability analysis gives those costs a customer, using counts of the activities that cause them. Get the product-margin layer right before adding cost to serve; our guide to Power BI gross margin analysis covers the margin % measure and why its totals must be recomputed, not averaged.
Invoice lines with customer, product, quantity, gross amount, discount and standard cost carry most of it. Add rebate accruals, freight bills or shipment records, credit memos for returns, and activity counts from the order, warehouse and helpdesk systems. Everything must share one customer key, or the cost lands on the wrong account.
| Layer | Typical source | Grain | Common trap |
|---|---|---|---|
| Gross sales | Invoice lines in the ERP or accounting system | Invoice line | Sales tax or freight billed to the customer mixed into the sales amount |
| On-invoice discounts | Invoice lines or price lists | Invoice line | A discount posted as its own negative line with no product on it |
| Rebates and allowances | Rebate agreements and accrual journals | Customer or agreement, by period | Booked as one ledger entry at period end that never reaches a customer |
| Cost of goods sold | Standard or average cost on the invoice line | Invoice line | No cost on non-stock or drop-ship items, so they show 100 percent margin |
| Freight out | Carrier invoices or a shipment table | Shipment | One shipment carrying several orders, or several customers on one route |
| Returns and credits | Credit memos and the returns log | Credit line | Only the refund counted, not the handling and restocking work |
| Service activity | Helpdesk tickets, order-entry logs | Ticket or order | Tickets logged against a contact or email address, not the account |
Decide the customer grain before you load anything. Most distributors invoice a bill-to account but ship to many locations, and some customers sit under a parent group with one buying agreement. Profit is usually calculated at the ship-to or bill-to level and rolled up to the parent for decisions, because you reprice an account, not a loading dock. Keep a customer mapping table that ties the ERP customer, the helpdesk organization and the carrier’s consignee name to one key; without it, the service and freight layers silently drop rows.
Neither arrives there on its own. Rebates accrue against an agreement and settle later, and freight is billed per shipment or as one carrier invoice. Allocate rebates to lines by eligible sales in the period, and split each shipment’s freight across its lines by weight or value, in Power Query.
For rebates, take the accrual for each customer and period and spread it across that customer’s eligible invoice lines in proportion to their net amount; lines outside the agreement, such as excluded product groups, get none. When a rebate settles at a different amount from the accrual, post the true-up to the period it settles in and label it, rather than reopening closed months. Prompt-payment discounts belong to the customer too, even though they are taken at payment rather than on the invoice.
For freight, the better source is a shipment table that links each shipment to its orders: split the carrier cost across the shipped lines by weight, or by value when weight is missing. If the only record is a monthly carrier total in the ledger, allocate it by each customer’s delivery count and say so on the report. Freight charged to the customer is revenue and freight paid to the carrier is cost. Show both, so a customer whose freight charge does not cover the carrier bill is visible rather than netted away.
Use activities that customers cause and your systems already count: orders, invoice lines picked, deliveries, returns and support tickets. Price each activity by dividing its monthly cost pool from the ledger by the month’s activity count, then charge every customer its counts multiplied by those rates. Five or six activities are usually enough to start.
| Activity | Driver count | Cost pool from the ledger | Where the count lives |
|---|---|---|---|
| Order entry | Orders | Order desk and customer service salaries | ERP sales orders |
| Picking and packing | Lines picked | Warehouse labor and packaging | Warehouse system or invoice lines |
| Delivery | Deliveries or stops | Own fleet and dispatch cost not already on the invoice line | Shipment or route table |
| Returns | Return lines | Returns handling, inspection and restocking | Returns log or credit memos |
| Customer support | Tickets | Support team cost | Helpdesk |
| Credit and collections | Overdue invoices | Accounts receivable team cost | AR aging |
Delivery is the one to watch for double counting. If carrier freight is already on the invoice line, the delivery activity should carry only your own dock and dispatch cost. A rate built from actuals, such as warehouse labor divided by lines picked, moves as volumes move. Some teams prefer a fixed rate set from the budget, which keeps customer profit steadier from month to month and leaves an unabsorbed balance to report. Either way, the cost charged to customers plus any unabsorbed balance must add back to the pools in the ledger.
Spreading cost to serve by revenue charges every customer the same percentage, so two accounts with equal sales get equal costs even when one places many small orders and sends stock back while the other orders full pallets. Margins converge, the expensive account looks fine and the efficient one subsidizes it without anyone seeing.
Take three customers in one month with 17,500 of cost to serve between them. A and B each buy 100,000 at the same 30,000 margin before cost to serve; C buys 50,000 at 14,000. The rates are sample figures for the illustration, not benchmarks: 40 per order, 5 per line picked, 90 per delivery, 60 per return line and 30 per support ticket.
| Customer | Orders | Lines picked | Deliveries | Return lines | Tickets | Cost to serve |
|---|---|---|---|---|---|---|
| Customer A | 10 | 200 | 10 | 1 | 2 | 2,420 |
| Customer B | 80 | 600 | 60 | 12 | 25 | 13,070 |
| Customer C | 10 | 100 | 10 | 2 | 3 | 2,010 |
| Total | 100 | 900 | 80 | 15 | 30 | 17,500 |
| Customer | Net revenue | Margin before cost to serve | Cost to serve by revenue | Profit by revenue (margin) | Cost to serve by activity | Profit by activity (margin) |
|---|---|---|---|---|---|---|
| Customer A | 100,000 | 30,000 | 7,000 | 23,000 (23.0%) | 2,420 | 27,580 (27.6%) |
| Customer B | 100,000 | 30,000 | 7,000 | 23,000 (23.0%) | 13,070 | 16,930 (16.9%) |
| Customer C | 50,000 | 14,000 | 3,500 | 10,500 (21.0%) | 2,010 | 11,990 (24.0%) |
| Total | 250,000 | 74,000 | 17,500 | 56,500 (22.6%) | 17,500 | 56,500 (22.6%) |
Charged by revenue, A and B look identical at 23.0 percent and the smaller C looks weakest at 21.0. Charged by activity, B drops to 16.9 percent because it places eight times as many orders and takes six times as many deliveries as A, and C, a small but orderly account, moves ahead of B at 24.0 percent. The total is 56,500 either way: the method changes who carries the cost, never how much there is. That makes the total a free check, because it must equal margin before cost to serve less the cost pools in the ledger.
Want to see which of your accounts look like Customer B? We can build the activity counts from your own systems.
Scope this for my data →Eight short measures do the work: net revenue, cost of goods sold, freight, cost to serve, customer profit, a profit rank, cumulative profit and its share of the total. The first three are plain sums over the invoice-line fact; cost to serve multiplies activity counts by a rate table.
The measures assume a Sales table at invoice-line grain with Gross Amount, Discount, Rebate, Std Cost and Freight columns, where Rebate and Freight were allocated to the line in Power Query as described above. An Activity table holds one row per customer, date and activity with a Count column, and relates many-to-one to an Activity Rate table keyed on the activity. A Customer dimension relates to both facts, and a marked Date table filters both. If rates change by month, key the rate table on activity and month instead.
| Measure | DAX expression | What it returns |
|---|---|---|
| Net Revenue | SUM( Sales[Gross Amount] ) - SUM( Sales[Discount] ) - SUM( Sales[Rebate] ) | Revenue after on-invoice discounts and allocated rebates |
| COGS | SUM( Sales[Std Cost] ) | Cost of goods sold on the lines in context |
| Freight | SUM( Sales[Freight] ) | Carrier cost allocated to the lines |
| Cost to Serve | SUMX( Activity, Activity[Count] * RELATED( 'Activity Rate'[Rate] ) ) | Each activity count priced at its rate, then summed |
| Customer Profit | [Net Revenue] - [COGS] - [Freight] - [Cost to Serve] | Profit after cost to serve, before shared overhead |
| Profit Rank | IF( HASONEVALUE( Customer[Customer] ), RANKX( ALLSELECTED( Customer[Customer] ), [Customer Profit] ) ) | 1 for the most profitable customer in the current selection |
| Cumulative Profit | VAR P = [Customer Profit] RETURN CALCULATE( [Customer Profit], FILTER( ALLSELECTED( Customer[Customer] ), [Customer Profit] >= P ) ) | Profit of this customer and every customer more profitable than it |
| Cumulative Profit % | DIVIDE( [Cumulative Profit], CALCULATE( [Customer Profit], ALLSELECTED( Customer[Customer] ) ) ) | Cumulative profit as a share of total customer profit |
Cumulative Profit works because the FILTER runs over every selected customer and evaluates Customer Profit for each one through context transition, then keeps the customers at or above the current one. Microsoft’s CALCULATE function reference (opens in new tab) explains how that filter replaces the customer on the row. Two customers with exactly the same profit share one cumulative value, and RANKX gives them the same rank by default; the RANKX function reference (opens in new tab) covers the Skip and Dense tie options. ALLSELECTED keeps both measures inside whatever region, sales rep or period the page is sliced to. With tens of thousands of customers the cumulative measure gets slow, and a pre-computed rank column for a fixed period is the usual fix.
Sort customers from most to least profitable and plot cumulative profit as a share of the total. When some customers lose money, the line climbs past 100 percent, peaks, then falls back to 100 as the loss-makers subtract. How far the peak sits above 100 percent is the profit the unprofitable tail gives away.
This shape is often called a whale curve. To build it, put Customer on the x-axis of a line chart, Cumulative Profit % as the value and Customer Profit in the tooltips, then sort the axis by Customer Profit, descending. Add a constant line at 100 percent so the peak reads at a glance. Beside it, put a table of the customers past the peak with net revenue, margin before cost to serve, each activity count and customer profit. The chart shows how big the tail is; the table shows why each account is in it, which is the part sales and operations need before they will act. For the same ranked cumulative line applied to revenue, SKUs or defect reasons, our guide to Power BI Pareto analysis covers the 80/20 version, including how to break ties so the line crosses 80 percent cleanly.
Fix the cause before you drop the customer. Loss-making accounts often lose money on how they buy, not what they buy: tiny orders, rush deliveries, heavy returns or constant support. Reprice, set minimum order sizes, charge freight or move them to a cheaper service channel, and only drop those whose costs genuinely disappear when they leave.
| Lever | What it changes | Measure to watch |
|---|---|---|
| Reprice or trim the discount | Net revenue per unit | Net Revenue, discount as a share of gross sales |
| Minimum order size or small-order fee | Orders and lines per unit of sales | Orders, Cost to Serve |
| Charge freight or set delivery days | Freight recovered and deliveries made | Freight, deliveries |
| Returns policy or restocking fee | Return lines and handling work | Return lines, credit memos |
| Self-service ordering or a support tier | Order-entry and ticket volume | Tickets, Cost to Serve |
| Exit the account | Revenue, product margin and avoidable cost to serve | Customer Profit, before shared overhead |
Exiting is the lever to treat with care. When a customer leaves, its revenue, product margin and the activity cost it caused go with it, but the rent, systems and salaries that every customer shares mostly stay. That is why this page stops at cost to serve and leaves those shared costs to a separate overhead allocation in Power BI, shown as its own line. After a repricing, a price-volume-mix analysis separates whether the customer’s revenue moved because of the new price or because it bought less. And before you chase a lapsing account, an RFM analysis tells you whether it is still buying at all.
Need a loss-maker list sales will trust? We show the activity counts behind every number.
Book a Free Demo →Bring in help when the numbers will drive pricing or account decisions and the inputs sit in separate systems: rebates in spreadsheets, freight on carrier invoices, tickets in a helpdesk, and customers keyed differently in each. The DAX on this page is short; building one customer key and agreeing activity rates with finance takes longer.
Power BI Flex Support is prepaid, senior-led Power BI hours that never expire, with no contracts and no project minimums. Blocks are Starter $2,500, Growth $4,600 and Power $8,000, and hourly work starts from $100. You send the request, we reply with a scope and an hours estimate before any work, hours are deducted only for work you approve, and most tasks land 3–5 business days after approval. If your invoices live in QuickBooks, customer profitability is one of the reports we build in a QuickBooks Power BI dashboard, with the freight, rebate and service layers joined in from their own sources. Contact is through the form on this site.
Buy a block of prepaid Flex hours and, if you’re unhappy within the first 4 hours, we refund you in full — no questions asked. Hours are deducted only for work you’ve reviewed and approved, and your banked hours never expire.
Related reading
Fair and square
Every request gets a scope estimate and the hours it needs before any work begins, so you approve the cost up front. Hours are deducted only for work you sign off on.
Your prepaid hours are banked immediately, with no contracts and no recurring charges. Whatever you don’t use stays on your account, with no deadline to spend it by.
You receive the report files, the semantic model, the DAX and the documentation, under your own Microsoft tenant and credentials. If you move the work in-house or to another partner, nothing is held hostage.
If you’re unhappy within the first 4 hours of your block, you get a full refund, no questions asked.
Straight answers. If a task is not a good fit for prepaid Flex hours, we will tell you rather than sell you something that will not serve you.
You work directly with Edward Pinela. The consultant who scopes your request is the same person who builds your data model, writes your DAX and designs your reports: a US-based, Microsoft-certified Power BI consultant with 20+ years on the Microsoft platform. No account managers in between, and nothing passed to an offshore team. About Edward
FAQ
Keep them apart. Cost to serve should hold only costs that move with a customer's activity, such as order entry, picking, delivery, returns and support. Rent, IT and finance salaries stay fixed when one customer leaves, so allocate them separately and show customer profit before and after shared overhead as two lines.
Precise enough to rank customers correctly, not precise to the cent. A rate built from a month of ledger cost divided by a month of activity is usually good enough to separate cheap and expensive accounts. Recalculate rates quarterly or when a process changes, and write the rates and their date on the report.
Yes, for the revenue and product margin layers. QuickBooks invoices carry the customer and item on each line, and inventory items carry a cost. Freight bills, rebate agreements and support tickets usually live elsewhere, so they are loaded separately and joined on a customer ID mapped to the QuickBooks customer list.
Price-volume-mix explains why revenue or margin changed between two periods, splitting the change into price, volume and mix effects. Customer profitability analysis is a snapshot of what each customer earns after the cost of serving them. They pair well: find the loss-making accounts here, then use price-volume-mix to check whether a repricing worked.
Yes. A senior, US-based, Microsoft-certified engineer can join your invoice lines, rebates, freight and activity data on one customer key, set the activity rates with finance and build the ranked profit view, using prepaid Flex hours that never expire. Blocks are Starter $2,500, Growth $4,600 and Power $8,000, with hourly work from $100. We quote the hours first.
Bring your invoice lines and whatever freight, rebate and service data you have to a free demo. We agree the customer key and the activity rates with you, then build the ranked profit view on prepaid hours that never expire. Most tasks land in 3–5 business days.
Scope approved before any hours are used · Hours never expire
Tell us the task. We scope it, you approve, and a senior consultant delivers — typically in 3–5 business days. Prepaid hours that never expire.