Skip to content
Last updated

Create a custom metric


Availability

userUsers, Editors, and Admins
accountAll accounts

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.

  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

TipTip: If you want to base a new metric on an existing one, you can duplicate it instead. Click the down arrow (chevron-down) next to any custom metric and select Duplicate. The duplicate opens pre-filled with the original settings, so you only need to adjust what's different.

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:

VariantSelectorsFiltering supportAdditional options
DatasetsMeasure, Date, Dimension✅ YesAggregation function
SpreadsheetsValue, Date, Dimension❌ NoAggregation function, Edit metric definition
Predefined API endpointsVaries by APIVaries by APIFavorable trend
Custom API endpointsQuery 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

NoteNote: The metric builder tool is available for select integrations. To find out if a particular integration supports it, refer to the Metric Library.

Aggregation functions

The Aggregation function selector determines how individual row values in the selected measure column are combined into a single metric value. Available options depend on the data type of the column:

AggregationNumberDatetimeText
AVG
COUNT
LATEST
MAX
MEDIAN
MIN
SUM
UNIQUE COUNT
  • AVG — Returns the arithmetic mean of all values in the selected date range.
  • COUNT — Counts the number of non-null rows.
  • LATEST — Returns the value from the most recent row, based on the order by column.
  • MAX — Returns the highest value. For datetime columns, this is the most recent timestamp.
  • MEDIAN — Returns the middle value when all numeric values are sorted in ascending order.
  • MIN — Returns the lowest value. For datetime columns, this is the earliest timestamp.
  • SUM — Adds up all values in the selected date range.
  • UNIQUE COUNT — Counts distinct values only, equivalent to COUNT DISTINCT in SQL.

Rename or exclude dimension values

WarningWarning: This feature is only available for legacy metric setups (such as SQL queries or A1 notation for spreadsheets) that predate the current dataset-based workflow. It will be fully deprecated later in 2026. For new workflows, use dataset column modifications instead.

While previewing data in the metric builder, you can rename or exclude individual dimension values directly from the Data Preview. Click Customize next to the dimension column header to access these options.

create-a-custom-metric

Rename a dimension value

  1. Click Customize > Rename dimension values.
  2. Select a dimension value from the dropdown.
  3. Enter a new name in the Enter new name field.
  4. Click Save.

Exclude a dimension value

  1. Click Customize > Exclude dimension values.
  2. Select the dimension value you want to exclude.
  3. Click Save.

Excluded values no longer appear as a dimension on Databoards. Renamed values are updated across all instances where that dimension is returned.

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 and Timezone.
  6. (Optional) Click Edit metric settings to:
  7. Enter a descriptive Name for the metric.
  8. Click Save.

FAQ

Can I use different date ranges for individual metric operands?

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.

How does time zone work for custom metrics?

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.