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

# Custom metrics and dimensions

> Make your own metric from a formula, or your own dimension that sorts rows into groups, and use it in any report.

When a report needs a number or a grouping Queryful doesn't have, make your own. A custom metric or dimension is saved for your store and appears alongside the built-in ones in every report on the same data.

## Custom metrics

A custom metric combines existing metrics with `+ - * /` and brackets. For example, net sales per item sold, or discounts as a share of gross sales.

1. On any report, open **Controls**, then **Add metric**, then **Create custom metric**.
2. Name it, and add a description if you like. The description shows when you hover over the metric.
3. Write the formula: start typing a metric, like "Net sales", and pick it from the list.
4. Choose how it's shown: number, money or percentage.
5. The preview shows its value for the last 30 days. Save it.

All the metrics in a formula must come from the same data, so a formula can't mix, say, sales and sessions.

## Custom dimensions

A custom dimension groups rows by a rule. Use fields with `if()`, comparisons, `and` and `or`, and functions like `upper()` and `year()`. For example, put orders into "Large" and "Small" by their total, or group products by a word in their title.

1. Open **Controls**, then **Add dimension**, then **Create custom dimension**.
2. Name it, write the rule, and save.

## Changing or deleting

Click a custom metric or dimension in **Controls** to edit it, or delete it from there. Reports that use it change with it.


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