# Create a custom metric

Basic metrics may not always provide the specific insights you need to track your business performance effectively. In Databox, custom metrics allow you to tailor your reporting to better reflect how your business defines success.

Instead of relying solely on predefined metrics from a data source, you can define your own logic, refine existing data, or combine multiple metrics to match your specific reporting needs and measure performance in a way that aligns with your goals.

## Create a custom metric

To get started:

1. Navigate to [Metrics > Custom Metrics](https://app.databox.com/metrics/custom-metrics).
2. Click **+ Custom metric**.
3. In the **Create a custom metric** dialog, choose how you want to build your metric:
  - **From a data source or dataset** – Select a data source and configure the metric using dimensions, filters, and aggregation options.
  - **With calculations** – Combine metrics and/or fixed values into a formula to create a derived metric.


create-a-custom-metric
### From a data source or dataset

Use this option to create a custom metric by selecting a data source or dataset and configuring it in the metric builder using dimensions, filters, and aggregation options.

1. Select a **data source** (or dataset) in the dialog to enter the Metric Builder flow.
2. Configure your metric in the metric builder. Available setup options vary depending on the selected source, as the builder adapts its workflow based on the data's origin. The available variants are:
  - Datasets
  - Spreadsheets
  - Predefined API endpoints
  - Custom API endpoints


The table below outlines the layout and available options for each metric builder variant:

| Variant | Selectors | Filtering support | Additional options |
|  --- | --- | --- | --- |
| **Datasets** | Measure, Date, Dimension | ✅ Yes | Aggregation function |
| **Spreadsheets** | Value, Date, Dimension | ❌ No | Aggregation function, Edit metric definition |
| **Predefined API endpoints** | Varies by API | Varies by API | Favorable trend |
| **Custom API endpoints** | Query parameters, Headers, Pagination method, JSONata expression | ✅ Yes (via JSONata) | Edit metric definition |


Regardless of the data source, you'll need to preview the data before saving the custom metric. This ensures the selected configuration is valid and produces accurate results.

The preview includes a limited number of rows, capped at:

- 200 rows for datasets
- 500 rows for spreadsheets
- 20 rows for API endpoints


The metric builder tool is available for select integrations. To find out if a particular integration supports it, refer to the [Metric Library](https://databox.com/metric-library/).

### With calculations

Use this option to create a new metric by combining multiple metrics and/or fixed values into a formula. This opens the formula editor, where you build an equation using metric operands (A, B, C, etc.) and operators.

To create a calculated metric:

1. Click **operand A** and select the first data source or dataset and metric you want to use.
  - Alternatively, choose **Set a fixed value** to enter a static number.
2. Use the **+ operator** to add an operation (add, subtract, multiply, divide).
  - Use parentheses to control the order of operations when needed.
3. Click **operand B** (and additional operands as needed) to complete the equation.
4. Review the **preview** to confirm the calculation returns the expected results.
5. Set the [Format](/change-number-format-and-scale) and **Timezone**.
6. (Optional) Click **Edit metric settings** to:
  - Add a description
  - Configure the favorable trend
  - Adjust [comparison functions](/change-comparison-settings)
7. Enter a descriptive **Name** for the metric.
8. Click **Save**.


You can quickly create a new metric by duplicating an existing one. Go to [Metrics > Custom Metrics](https://app.databox.com/metrics/custom-metrics), click the **down arrow** (![chevron-down](/assets/chevron-down.dfd0e90adc6eb576be32262463090aae7c7f5408ed7975e3795f69775e36d174.419bb737.svg)) next to the metric you want to copy, and select **Duplicate**. Then adjust the settings as needed and save the new metric.

Yes. Each metric operand can have its own date range.

To set this up, click the operand, open **Advanced Settings**, and choose the desired date range. Then enable **Retain metric settings for all date ranges** to ensure the selected range is always applied, regardless of the date range selected in the visualization.

Keep in mind that relative date ranges (for example, “Last 30 days”) will continue to update dynamically based on the current date.

Each data source and dataset in Databox has its own time zone setting. When you build a custom metric using metrics from multiple data sources or datasets, those inputs may not share the same time zone.

To ensure the calculation aligns values to the same dates and time periods, Databox requires you to choose a **Timezone** for the calculated metric. The selected time zone is used to interpret and aggregate time-based data consistently across all operands in the formula.

 

Ask Genie
Get instant answers or help with your data using the in-app AI assistant.

Talk to an expert
For customers: Get help with your setup, strategy, or making the most of Databox.

Book a demo
New to Databox? See how it works and get guidance on getting started.

Send an email
Reach out to support for help with your account, data, or technical issues.