Analytics and Tracking

Calculated Field

A new metric or dimension built from a formula on data a report already has, such as ad cost divided by leads to show cost per lead.

Quick facts: Calculated Field

Category
Analytics and Tracking
Level
Intermediate
Affects
Reporting accuracy, dashboards, KPI tracking
Where to see it
Looker Studio, GA4 calculated metrics, Google Sheets, Excel
In this article4
  1. How a calculated field works
  2. Why it matters
  3. Common mistakes
  4. How to act on it

A calculated field is a new metric or dimension you create with a formula built from data a report already has, such as dividing ad spend by the number of leads to show cost per lead. The term is most common in Looker Studio, but spreadsheets, GA4 and most reporting tools offer the same idea under similar names.

How a calculated field works

You write a formula that refers to existing fields, and the tool works out the answer for every row and every total in a chart. Looker Studio lets you add one in two places: on the data source, so every report built on that source can reuse it, or on a single chart, where it exists only in that chart. GA4 has its own version, called calculated metrics, created in Admin under custom definitions, with a small limit on how many each standard property can hold.

Most calculated fields fall into three groups:

  • Ratios. SUM(Cost) / SUM(Conversions) gives cost per conversion; revenue divided by cost gives return on ad spend.
  • Groupings. A CASE statement can sort campaign names into Brand, Generic and Competitor by matching patterns in the name, so a sprawling account reads as three lines.
  • Clean-ups. Removing VAT from revenue, trimming a full URL to its page path, or merging facebook.com, m.facebook.com and l.facebook.com into one source.

The formula language resembles spreadsheet functions, with CASE, IF, REGEXP_MATCH, IFNULL, text functions and date functions doing most of the work.

Why it matters

The figures a business actually runs on are rarely the ones a platform shows by default. A London accountancy practice cares about cost per qualified enquiry, not clicks. A VAT-registered online shop wants return on ad spend worked out on revenue after VAT, because that is the money it keeps. Calculated fields put those numbers straight onto the dashboard, instead of someone rebuilding them in a spreadsheet every month, which is where copy-and-paste errors creep in.

They also put channels on the same footing. When Google Ads, Meta and email all feed one report, a calculated field can apply one definition of a lead, or one custom channel grouping, to all of them, so you compare like with like.

Common mistakes

  • Averaging ratios. If you work out conversion rate on each row and then average the rows, a campaign with ten clicks counts as much as one with ten thousand. Divide the totals instead, SUM(Conversions) / SUM(Clicks), so the overall figure is weighted correctly.
  • Ignoring division by zero. A campaign with no conversions returns a blank, which can throw out sorting and totals. Wrap the formula so it shows zero, or a clear “no conversions” label, instead.
  • Removing VAT at one rate. Dividing revenue by 1.2 works for goods at the 20% standard rate, but children’s clothes, books and most food are zero-rated in the UK. A mixed catalogue needs the VAT figure from the shop platform, not a blanket formula.
  • Unexplained names. Six months later nobody remembers why “Leads (adj)” differs from “Leads”. Name fields plainly and put the definition in the field’s description.
  • Calculating on a faulty blend. When a blended data source joins tables on the wrong key, rows are duplicated and every figure the formula touches is inflated.

How to act on it

List the five or six numbers you make decisions on each month and check whether your reports show each one directly. For any that are missing, write the definition in plain English first, for example “cost per lead equals Google Ads cost divided by form submissions plus calls longer than 60 seconds”, and agree it with whoever reads the report. Then build the field on the data source so every chart uses the same version.

Before anyone relies on it, test the field against a figure you can work out by hand for one week and one campaign. If the two disagree, check the field’s aggregation setting and any chart filters first; those cause most mismatches.

When paid channels are run against one cost-per-lead or ROAS target, as in performance marketing, that agreed formula effectively is the target. Settle it before the first report, not after the first disagreement about whether the campaigns are working.

Do and do not

Do

  • Divide totals rather than averaging row-level ratios
  • Write the definition in plain English before writing the formula
  • Build shared fields on the data source, not chart by chart

Do not

  • Strip VAT at a single rate from a mixed-rate catalogue
  • Leave division by zero unhandled
  • Give fields vague names such as Leads (adj)

Questions people ask about this

Can I create calculated fields in GA4 itself?

Yes, as calculated metrics, which you set up in Admin under custom definitions and then use in reports and explorations like any other metric. Standard GA4 properties allow only a handful, so keep them for figures you look at constantly. Anything more involved is easier to build in Looker Studio or a spreadsheet.

Why does my calculated field show a different total from the platform?

Usually the order of operations is different: the report may be adding up row-level ratios rather than dividing the totals, or a chart filter is excluding data the platform includes. Compare one day and one campaign against the source first. Once those match, widen the date range.

Do calculated fields change my underlying data?

No. They are worked out each time the chart loads, from whatever the connector returns, so editing or deleting one changes nothing in Google Ads, GA4 or the original source. The flip side is that a complicated formula on a large data source can make a report slow to load.

Related terms

Found this useful?

Share it, or ask an AI to summarise it

Back to the glossary

Knowing the term is the easy part

Applying it to your own site and budget is the work. Book a call and I will tell you what actually applies to you.