Two Minute Reports Logo
Custom Fields

Formulas & Conditions

Build custom metrics with math operators and custom dimensions by combining fields and text, then layer on conditional rules to return values only when conditions match.

The Formula method is the most flexible way to build a custom field. For metrics it's a math expression; for dimensions it combines fields and text into a label. On top of either, you can add conditional rules so the field only returns a value when your conditions match.

Formulas for Metrics

A custom metric formula is an arithmetic expression built from fields, numbers, and operators. You assemble it in the formula editor by adding field chips, typing numbers, and inserting operators.

Building a Formula

  • Click Browse Fields (or start typing a field name) to insert a field
  • Type a number and press Enter to add a numeric constant
  • Click Browse Operators to insert a math operator

The editor validates as you go, with messages like "Formula looks good", "Formula ends with an operator", or "Missing operator between fields".

Operators

OperatorMeaning
+Add
Subtract
×Multiply
÷Divide
%Modulo (remainder)
^Power
( )Parentheses for grouping
Fields are aggregated automatically based on the fields used, you don't write SUM or AVG. Write the formula as if on totals, for example spend ÷ conversions.

Common Metric Recipes

MetricFormula
CPA (cost per acquisition)spend ÷ conversions
ROAS (return on ad spend)revenue ÷ spend
CPC (cost per click)spend ÷ clicks
Conversion rateconversions ÷ clicks × 100
AOV (average order value)revenue ÷ orders
The builder includes an Examples panel with ready-made recipes like these. Open it to drop a starting point into the editor and tweak from there.

Formulas for Dimensions

For dimensions, the Formula method combines fields and text into a single value instead of doing math. This is how you build labels and cleaned-up names.

  • Add field chips the same way as for metrics
  • Type text and press Enter to add a text constant
  • Use Add Space to insert a space between parts

For example, combine a source field, a space, and a medium field to produce a "Source / Medium" label. (Math operators aren't available for dimensions, dimensions are about text, not calculations.)

Conditional Rules

Turn on Set condition in the builder to make a field return its value only when your conditions match. This is CASE-style logic: "when the campaign name contains 'brand', label it Branded".

How Conditions Work

Each condition reads When field operator values:

OperatorMatches when the field…
Equalsexactly matches a value
Not Equalsdoes not match
Containsincludes the text
Not Containsdoes not include the text
  • Add multiple conditions and join them with AND / OR
  • Values autocomplete from the real distinct values in your data

Multiple Rules (Dimensions)

Custom dimensions support multiple rules for IF/ELSE-style mapping. Click + Add Rule to add another rule; rules are evaluated top to bottom and the first matching rule wins. A final rule with no condition acts as the "else" catch-all. If nothing matches, the field uses its fallback value.

Order matters: put your most specific rules first and a general catch-all last, so a value doesn't get caught by a broad rule before reaching a precise one.

Next Steps

Copyright © 2026