Your data source has Conversions and Sessions as separate metrics — but no conversion rate. You could compute it in a spreadsheet, or ask an engineer to add a column. The faster path: create a calculated field directly in Data Studio. No pipeline changes, no waiting, and the result updates automatically as new data comes in.
Calculated fields come in two varieties: data source-level fields, which you define once and can use in any chart across any report that uses that source, and chart-level fields, which live inside a single chart and are faster to set up for one-off needs.
Data source-level fields
Data source-level fields are defined in the data source editor. Any report that connects to that source can use the field, and you only have to maintain the formula in one place.
To create one:
- In your report, go to Resource > Manage added data sources.
- Find the data source you want to modify and click the Edit (pencil) icon.
- In the data source editor, click Add a field in the top-right corner.
- Give the field a name, write your formula, and set the field type (Metric or Dimension) and any formatting (currency, percent, etc.).
- Click Save and then Done to return to the report.
The new field appears in the field list alongside your native fields and behaves the same way in charts.
Chart-level fields
Chart-level fields are created directly from within a chart, without touching the data source. They are faster for experimental or one-off metrics — useful when you want to try something without committing it to the shared data source.
To create one:
- Select the chart you want to add the field to.
- In the Setup panel on the right, click the + button next to the metric or dimension slot where you want the field to appear.
- Choose Create field from the dropdown.
- Write your formula, name the field, and confirm.
The key trade-off: chart-level fields do not transfer when you copy a chart. If you duplicate a chart that uses a chart-level field, the copy won't include the calculated field — you'll need to recreate it. If you find yourself using the same formula in multiple charts, move it to the data source level instead.
Formula syntax basics
Looker Studio formulas use a syntax that will feel familiar if you've written spreadsheet formulas or basic SQL.
Aggregation functions like SUM(), AVG(), COUNT(), MAX(), and MIN() collapse row-level values into a single number. Most metric calculated fields will use at least one.
The most important rule: aggregate first, then operate. To compute a ratio like conversion rate, write SUM(Conversions) / SUM(Sessions) — not SUM(Conversions / Sessions). The second form divides at the row level before aggregating, which produces a different (and usually wrong) number.
Field type matters. When you define a calculated field, you choose whether it is a Metric (a number that gets aggregated in charts) or a Dimension (a categorical label used for grouping). A formula that returns true or false should be a Dimension, not a Metric. A formula that returns a calculated number you want to sum or average should be a Metric. If you pick the wrong type, your chart will either refuse to display the field or aggregate it in a way you don't expect.
Text functions like CONCAT() and REGEXP_MATCH() operate on individual field values rather than aggregates. These almost always produce Dimension fields.
SixSeven copy-paste formulas
1. Conversion rate
Conversions / Sessions
Format the field as Percent. This is a simple division of two native metrics — Data Studio aggregates both before dividing at the chart level, so no explicit SUM() is needed when the fields are already pre-aggregated metrics. Note: this only applies when using a connector that pre-aggregates metrics (such as the GA4 or Google Ads default connectors). For row-level data sources (BigQuery, custom SQL), use SUM(Conversions) / SUM(Sessions) instead. Set the field type to Metric.
2. Average order value
SUM(Revenue) / COUNT(Transactions)
Divide total revenue by the count of transactions. Use this when your data source exposes row-level revenue and transaction data rather than pre-aggregated totals. Set the field type to Metric and format as currency.
3. Channel segment (CASE WHEN)
CASE
WHEN Session Default Channel Group = "Organic Search" THEN "SEO"
WHEN Session Default Channel Group = "Paid Search" THEN "Paid Search"
WHEN Session Default Channel Group = "Email" THEN "Email"
ELSE "Other"
END
CASE WHEN evaluates each condition in order and returns the first match. Always include an ELSE clause — without it, unmatched rows silently return null, which can corrupt totals and filters. Set the field type to Dimension so you can use it as a chart breakdown.
4. Blog page flag (REGEXP_MATCH)
REGEXP_MATCH(Page Path, "^/blog/")
Returns true for any page whose path starts with /blog/ and false for everything else. Set the field type to Dimension. You can then filter charts to only include rows where this field equals true, or use it as a breakdown to compare blog vs. non-blog pages. See the regex guide for more on the pattern syntax.
5. Combined location label (CONCAT)
CONCAT(Country, " — ", City)
Joins two dimension fields with a separator string. Useful when you want a single dimension that shows both country and city in one label (e.g. United States — New York). Set the field type to Dimension.
6. Sessions per user
Sessions / Total Users
Divides sessions by unique users to show how often users return. Like formula 1, both fields are pre-aggregated metrics, so no explicit SUM() is required. Note: this only applies when using a connector that pre-aggregates metrics (such as the GA4 or Google Ads default connectors). For row-level data sources (BigQuery, custom SQL), use SUM(Sessions) / SUM(Total Users) instead. Set the field type to Metric and format as a decimal number.
7. Count unique pages
COUNT_DISTINCT(Page)
Counts the number of unique page paths in your dataset — useful for measuring the breadth of your content rather than the depth of any single page.
Pair it with Search Console data to see how many distinct pages are receiving impressions or clicks. A low count means most of your traffic concentrates on a handful of URLs; a growing count over time signals that more of your content is gaining visibility in search.
The same function works across any dimension. COUNT_DISTINCT(Query) tells you how many unique search queries are driving traffic — a proxy for your keyword footprint. If you track this month over month, you can see whether your content is reaching new search territory or consolidating around the same queries.
Note that COUNT_DISTINCT only counts rows present in your current dataset. If your chart is filtered to a date range or a segment, the count reflects that scope, not your full site history.
Common mistakes
Dividing before aggregating. Writing SUM(Revenue / Sessions) divides revenue by sessions at the row level for each record, then sums those ratios. That produces a different result from SUM(Revenue) / SUM(Sessions), which computes total revenue divided by total sessions — which is what you actually want. Always push the aggregation outside the operation.
Getting the field type wrong. If you create a conversion rate field but set it to Dimension instead of Metric, Data Studio will try to use it as a grouping label rather than a number. The chart will look broken, or the field simply won't appear where you expect it. If a formula produces a number you want to aggregate, it's a Metric. If it produces a label or category, it's a Dimension.
Forgetting that chart-level fields don't copy. When you duplicate a chart to reuse its layout, any chart-level calculated fields disappear from the copy. If you've built something worth keeping, move it to the data source before duplicating. Go to Resource > Manage added data sources > Edit and add it there instead.
Quick recap
- Data source-level fields are created via Resource > Manage added data sources > Edit and are available in every chart that uses that source.
- Chart-level fields use the + button inside a chart's Setup panel — faster for one-offs, but they don't copy with the chart.
- Aggregate first, then operate: use
SUM(A) / SUM(B), notSUM(A / B). - Set the field type to Metric for numbers you want aggregated, Dimension for labels and categories.
- Always include an
ELSEclause inCASE WHEN— without it, unmatched rows silently returnnull, which can corrupt totals and filters. REGEXP_MATCHreturns a boolean — make it a Dimension and filter or break down by it.- Chart-level fields don't transfer when you copy a chart — promote frequently used formulas to the data source.
For blended data sources, the same formula rules apply, but remember that metrics inside a blend become unaggregated dimensions — you'll need explicit SUM() wrappers. Full details in the data blending guide.
