Skip to main content

Data Studio export: Custom metric calculations

Understand how Data Studio calculates Funnel rule metrics and formula metrics.

Funnel exports rule metrics and formula metrics to Google Data Studio. Each metric type uses a different calculation stage.

Rule metrics

Funnel calculates a rule metric for each row before it aggregates the data. Google Data Studio then aggregates the exported values like other metrics.

Formula metrics

A formula metric uses an arithmetic expression, such as:

CPC = cost / clicks

Funnel exports the formula instead of a calculated value. Google Data Studio requests the required fields from Funnel and calculates the result after it aggregates those fields.

For example, Funnel exports the CPC formula as:

SUM(cost) / SUM(clicks)

Google Data Studio calculated fields

Google Data Studio also supports row-level and post-aggregation calculated fields.

  • cost * 2 calculates a value for each row. Google Data Studio can aggregate the results.

  • SUM(cost) / SUM(clicks) calculates a value after aggregation. Google Data Studio sets the aggregation type to Auto and does not aggregate the result again.

Do not combine an aggregated field with a nonaggregated field in the same formula. For example, this formula causes an error:

SUM(cost) / clicks

Aggregate both fields or remove the aggregation function.

Did this answer your question?