> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upstackdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Transaction Cost per Order: How to Calculate It in Upstack

> Transaction Cost per Order isn't a built-in measure in Upstack. Build it as a custom measure from Total Transaction Cost and Orders, with the formula.

> [!TIP]
>
> Transaction Cost per Order is the average payment gateway and Transaction-category cost per order. Upstack doesn't ship it as a single measure, but you can build it as a custom measure from the measures it does have.

## Formula

> [!NOTE]
>
> **Transaction Cost per Order** = [**Total Transaction Cost**](https://docs.upstackdata.com/reference/metrics/orders/transaction/total-transaction-cost.md) ÷ [**Orders**](https://docs.upstackdata.com/reference/metrics/orders/counts/orders.md)

### Build it as a custom measure

In a custom dashboard, open **Custom Measures**, set the format to **Currency** and the period total to **Average**, then enter:

```text theme={null}
orders.total_transaction_cost / orders.count
```

**Average** makes Upstack divide the period totals, instead of averaging a ratio for each day.

See [Custom Measures](https://docs.upstackdata.com/analytics/custom-measures.md) for the builder.

***

## Related Metrics

| Metric | Relationship |
| - | - |
| [Total Transaction Cost](https://docs.upstackdata.com/reference/metrics/orders/transaction/total-transaction-cost.md) | The numerator |
| [Gateway Cost Per Order](https://docs.upstackdata.com/reference/metrics/orders/transaction/gateway-cost-per-order.md) | Gateway part only, built in |

[See all Transaction metrics →](https://docs.upstackdata.com/reference/metrics/orders/transaction)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.