# Unit costs

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](/concepts/access-model).
- Charting a unit cost needs a saved report; see [Save and manage reports](/cost-reports/manage).

## Create a business metric

<Stepper>

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**.

</Stepper>

:::note
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

<Stepper>

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**.

</Stepper>

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.

```csv
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](/api), and [Terraform](/developers/terraform) for the `costfluent_business_metric` resource.

## Chart cost per unit

<Stepper>

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**.

</Stepper>

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](/concepts/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](/cost-reports/manage)
- [Explore cost data](/cost-reports/explore)
- [Cost amounts](/concepts/cost-amounts)
