Power BI How-To / Finance Analysis

Customer Profitability Analysis in Power BI: Net Revenue, Cost to Serve and the Unprofitable Tail

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

Four layers from invoice to customer profit

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.

Product margin

Net revenue less cost of goods sold and the freight paid to ship it. This is where most customer reports stop.

Cost to serve

Orders, lines picked, deliveries, returns and tickets, each counted per customer and priced at a rate built from the ledger.

Rank and act

Sort customers by profit, plot the cumulative total, and decide for each loss-maker whether to reprice, change terms or let it go.

What is customer profitability analysis in Power BI?

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.

What data does a customer P&L need?

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.

The layers of a customer P&L, where each one usually comes from, and the trap that most often breaks it.
Layer Typical source Grain Common trap
Gross salesInvoice lines in the ERP or accounting systemInvoice lineSales tax or freight billed to the customer mixed into the sales amount
On-invoice discountsInvoice lines or price listsInvoice lineA discount posted as its own negative line with no product on it
Rebates and allowancesRebate agreements and accrual journalsCustomer or agreement, by periodBooked as one ledger entry at period end that never reaches a customer
Cost of goods soldStandard or average cost on the invoice lineInvoice lineNo cost on non-stock or drop-ship items, so they show 100 percent margin
Freight outCarrier invoices or a shipment tableShipmentOne shipment carrying several orders, or several customers on one route
Returns and creditsCredit memos and the returns logCredit lineOnly the refund counted, not the handling and restocking work
Service activityHelpdesk tickets, order-entry logsTicket or orderTickets 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.

How do freight and rebates reach the invoice line?

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.

Which cost-to-serve drivers should you use?

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.

Common cost-to-serve activities, the count that drives each one, the ledger cost behind it and where the count lives.
Activity Driver count Cost pool from the ledger Where the count lives
Order entryOrdersOrder desk and customer service salariesERP sales orders
Picking and packingLines pickedWarehouse labor and packagingWarehouse system or invoice lines
DeliveryDeliveries or stopsOwn fleet and dispatch cost not already on the invoice lineShipment or route table
ReturnsReturn linesReturns handling, inspection and restockingReturns log or credit memos
Customer supportTicketsSupport team costHelpdesk
Credit and collectionsOverdue invoicesAccounts receivable team costAR 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.

Why does revenue-based allocation flatten margins?

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.

Illustrative sample data, not client results: one month of activity counts and the cost to serve they produce at the sample rates (generic currency units).
Customer Orders Lines picked Deliveries Return lines Tickets Cost to serve
Customer A1020010122,420
Customer B8060060122513,070
Customer C1010010232,010
Total10090080153017,500
The same 17,500 charged by revenue and by activity: customer profit and margin on net revenue under each method.
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 A100,00030,0007,00023,000 (23.0%)2,42027,580 (27.6%)
Customer B100,00030,0007,00023,000 (23.0%)13,07016,930 (16.9%)
Customer C50,00014,0003,50010,500 (21.0%)2,01011,990 (24.0%)
Total250,00074,00017,50056,500 (22.6%)17,50056,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 →

Which DAX measures build the customer P&L?

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.

The core customer profitability measures.
Measure DAX expression What it returns
Net RevenueSUM( Sales[Gross Amount] ) - SUM( Sales[Discount] ) - SUM( Sales[Rebate] )Revenue after on-invoice discounts and allocated rebates
COGSSUM( Sales[Std Cost] )Cost of goods sold on the lines in context
FreightSUM( Sales[Freight] )Carrier cost allocated to the lines
Cost to ServeSUMX( 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 RankIF( HASONEVALUE( Customer[Customer] ), RANKX( ALLSELECTED( Customer[Customer] ), [Customer Profit] ) )1 for the most profitable customer in the current selection
Cumulative ProfitVAR 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.

What does a ranked cumulative-profit view show?

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.

What should you do with unprofitable customers?

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.

Levers for an unprofitable customer, what each one changes, and the measure that shows whether it worked.
Lever What it changes Measure to watch
Reprice or trim the discountNet revenue per unitNet Revenue, discount as a share of gross sales
Minimum order size or small-order feeOrders and lines per unit of salesOrders, Cost to Serve
Charge freight or set delivery daysFreight recovered and deliveries madeFreight, deliveries
Returns policy or restocking feeReturn lines and handling workReturn lines, credit memos
Self-service ordering or a support tierOrder-entry and ticket volumeTickets, Cost to Serve
Exit the accountRevenue, product margin and avoidable cost to serveCustomer 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 →

When should a senior engineer build it for you?

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.

Try us risk-free for 4 hours

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.

Fair and square

Our promises, in plain English

Scope approved before any hours are used

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.

Hours never expire

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 own everything, in your tenant

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.

Refund in your first 4 hours

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

Frequently asked questions

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.

Want to know which customers really pay their way?

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

Book a free demo

See what your Power BI reporting would take

Tell us the task. We reply within one business day, and you get a scope estimate and the hours needed before any work begins.

Step 1 of 2: What do you need?

How can we help? Pick one

Tap to add, or type your own:

Step 2 of 2: Where should we reply?

Used only to contact you about this inquiry.

We reply within one business day. Scope approved before any hours are used. We don’t sell your information.

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.

  • Prepaid hours from $100/hour — and they never expire
  • Senior-led delivery — 20+ years on the Microsoft platform
  • Typical 3–5 business day turnaround
  • Full refund if you’re unhappy in your first 4 hours
Book my free demo