Allocate and charge back

Measure cost per customer or per unit

Upload a business metric such as active customers, chart a product's cloud cost per customer and its gross margin, put the figure on a dashboard and read whether it rises or stays flat.

By the end of this guide, you have a saved report that charts one product's cloud cost per customer, or per any unit your business counts, month by month, with the change in cost and in customers behind it, and the figure on a dashboard. It is for the CTO or founder who has to say whether a growing bill is growing faster than the business, and for leadership, who reads the answer. The path goes from a report narrowed to one product, through a business metric uploaded as a CSV file, to the unit cost on the report and on a dashboard. Each step links to the page that owns the detail.

Before you start

  • Cost you can narrow to what you measure: a tag such as product on the resources, or a segment per product. A unit cost of the whole workspace needs neither. See Tags and tag coverage and Segments and allocation rules.
  • A count of the unit from your own systems, such as active customers per product from your billing or product database, and for a gross margin the revenue in the same days.
  • Edit access to the workspace, to create the business metric, upload its values and save the report; see Access model.
  • Every step works on the sample data a new organization starts with, whose rows carry the tag product with the values analytics, checkout and storefront, once you upload counts of your own for its months in step 2.

1. Narrow a report to what you measure

Open Cost reports, select Add filter, choose Tag, enter product as its Tag key and pick the product, such as checkout. Where a segment holds the product, filter by the segment instead, so its share of shared cost counts too; where the tag is missing or spelled several ways, a virtual tag gives every line one value. A cost per customer across every product needs no filter. Set Granularity to "Monthly" and Date range to "Last 6 months", so each month is one point of the line, then select Save as new, give the report a Title such as "Checkout cost per customer" and select Save report. See Filter the cost and Save as a new report.

2. Upload the business metric

Open Business metrics under Reporting and select New metric. Enter a Name, such as "Active customers", and a Unit in the singular, such as customer. To divide each product's cost by its own customers, enter product under Label columns, then select Create metric. In Upload values, which opens next, Download a sample file saves a file with the metric's own columns; fill it in, choose it as the CSV file and select Upload. See Create a business metric and Upload values from CSV.

A month adds up the daily amounts it holds. A unit that adds up, such as orders or API requests, goes in every day. A count such as active customers goes in once a month, on the month's first day, so the month divides by the count rather than by a sum of daily counts:

Code
date,amount,product 2026-09-01,420,checkout 2026-09-01,1150,storefront 2026-10-01,455,checkout 2026-10-01,1210,storefront

On the sample data, any counts dated within its months will do. The metric stays when the sample data leaves, so delete it once your real counts are ready to upload.

3. Chart the cost per customer

On the saved report, open More actions and choose Unit cost. Choose the metric, Cost per unit under Calculation and, for a metric with a product label column, the same product under Count only these labels as the report's filter holds, such as checkout. For a figure per thousand requests rather than per request, choose a Scale. Select Apply, then Save changes: the chart draws a "Cost per" line on its own axis on the right, and an "Average cost per" card gives the range's figure. See Chart a unit cost.

For a gross margin, create a second metric whose Unit is the report's currency code, such as EUR, upload the product's revenue in that currency, apply it to the report with Gross margin as the Calculation, and keep that as a second report with Save as new. It sets that revenue against the cost the report counts, not against your company's whole cost.

4. Put it on a dashboard

On the saved report, select Add to dashboard under More actions, choose A dashboard and pick one, or New dashboard with a Dashboard title, choose Chart as the Display and select Add to dashboard. Choose Chart because a KPI widget shows the report's total cost alone, while a chart widget draws the unit cost as the report does. See Add a report to a dashboard and What a widget shows.

5. Read whether it rises or stays flat

Turn on Compare to previous period under Options and select Save changes. The unit cost's card then states, behind its figure, how the cost changed and how the metric changed over the same days. Read the two together:

  • A flat cost per customer means cost grows in step with the business: a larger bill, paid for by more customers.
  • A rising one means cost grows faster than customers, or customers fell while cost stayed. Find what grew with Investigate a cost increase before you decide.
  • A falling one means each customer costs less, as shared cost spreads over more customers or a saving lands.
  • A gross margin that falls while the cost per customer stays flat points at revenue per customer, not at cost.

A gap in the line is a month without a metric value, never a cost of zero: check the metric's Values on Business metrics for its last day before you read the newest month. See How it behaves.

Check the result

  • Business metrics shows the metric's Values: how many it holds, and its first and last day.
  • The saved report draws the "Cost per" line beside its cost, and its "Average cost per" card names the change in cost and in the metric.
  • The dashboard shows the report as a chart widget with the same line.

Keep it true

Costfluent recommends adding each month's count as soon as the month closes, before the Run a monthly cost review, or sending it from your billing system through the Public API, so the newest month is never read without its metric.

From your assistant

With the Costfluent MCP server connected, your assistant answers these with list_cost_reports and get_cost_report_data.

Code
What was the cost per customer in each month of our saved report "Checkout cost per customer", and is it rising or falling?
Code
In our saved report "Checkout cost per customer", how much did the cost and the number of customers change against the previous period?