Costfluent Docs
  • Pricing
  • Changelog
  • costfluent.com
  • Documentation
  • Guides
  • API Reference
Product
  • Pricing
  • Security
  • Changelog
Developers
  • API reference
  • Terraform
  • llms.txt
Legal
  • Privacy
  • Terms
  • Imprint
Get started
Concepts
Connect a source
Reporting
    Cost reports overviewExplore cost dataFilter with CQLSave and manage reportsUnit costsShare and schedule reportsOverview and dashboardsFolders
Allocation
Planning
Optimization
Administration
Developers
Reporting

Unit costs

Import a business metric such as customers or transactions by CSV or the Public API, and chart a saved report's cost per unit of it beside its cost.

A business metric is a quantity your business counts each day, such as active customers, orders or API requests. A saved cost report that names one charts its cost per unit of the metric beside its cost, on a second axis: each day's, week's, month's or quarter's cost over the metric's amount in that period.

Before you start

  • Creating, renaming, filling and deleting business metrics needs the Owner or Editor team role in a workspace your team can edit. Every team role can read them. See Access model.
  • Charting a unit cost needs a saved report; see Save and manage reports.

Create a business metric

  1. Open Business metrics under Reporting and select New metric.
  2. In Create business metric, enter a Name and a Unit, what one unit counts in the singular, such as customer.
  3. Optionally enter Label columns, up to five separated by commas, such as region or plan. Each value can then be labelled by them.
  4. Select Create metric.

A metric's label columns are fixed once it exists, because every stored value is keyed by them. Edit business metric renames the metric or its unit only.

Upload values from CSV

  1. On Business metrics, select the upload icon on the metric's row, "Upload values for" followed by its name.
  2. In Upload values, choose a CSV file and select Upload.

The file has a header row with a date column (YYYY-MM-DD), an amount column (a number, zero or more) and any of the metric's label columns, in any order. Each row is one day for one combination of labels; a label column a row leaves empty is unlabelled.

Code
date,amount,region 2026-09-01,120,eu 2026-09-01,80,us 2026-09-02,125,eu

A summary such as "3 new, 0 replaced, 0 unchanged" says what the upload did. Each row replaces the value the metric already holds for its day and labels, so uploading the same file again changes nothing.

Send values through the Public API

POST /v1/business-metrics/{metricId}/values takes up to 10,000 values a request, each a date, an amount as a decimal string and optional labels by column, and stores them the same way: each replaces the value of its day and labels. GET /v1/business-metrics/{metricId}/values reads them back by day. See the API reference, and Terraform for the costfluent_business_metric resource.

Chart cost per unit

  1. Open a saved report and select Edit.
  2. Under Unit cost, choose the metric, shown as its name and "(per" its unit. None charts cost alone.
  3. Select Save changes.

The report's chart then draws a "Cost per" line, named with the metric's unit, against its own axis on the right, and an "Average cost per" card shows the range's cost over the metric's amount, counting only the periods that have both.

How it behaves

  • A unit cost needs the Cost measure and a granularity of Daily, Weekly, Monthly or Quarterly. Any other choice is refused with "A unit cost needs the cost measure and a day, week, month or quarter bin."
  • A week runs Monday to Sunday, and a week, month or quarter sums the metric's daily amounts within the report's range.
  • A period with no metric amount, or an amount of zero, has no cost per unit: the line breaks there rather than dropping to zero.
  • Every label is summed: the unit cost divides by the metric's whole amount for the period.
  • A report whose costs are in more than one currency with conversion off has no unit cost; see Cost amounts.
  • An upload is all or nothing: one row with a date that is not YYYY-MM-DD, an amount that is not a number or below zero, a label column the metric does not have, a label a spreadsheet would read as a formula, or a day and labels already on an earlier row refuses the file, naming the first rows that fail. A file holds at most 100,000 rows and 9 MB; split a larger one by date.
  • Deleting a metric deletes its values, and a report charting its unit cost goes back to cost alone.
  • A dashboard widget shows a report's unit cost as the report does. A share link shows the report's cost only.

Related

  • Save and manage reports
  • Explore cost data
  • Cost amounts
Save and manage reportsShare and schedule reports
On this page
  • Before you start
  • Create a business metric
  • Upload values from CSV
  • Send values through the Public API
  • Chart cost per unit
  • How it behaves
  • Related