Sometimes, even though your dataset has many fields, it may lack one you need. In these cases, you should assess whether it can be derived from the available fields and, if so, create it.
This is the first blog post on custom fields, and we’ll focus on creating metrics. I’ll walk you through some examples I frequently use.
1. Differences between metrics and dimensions
You may have noticed that some fields in your data source are green while others are blue. The green ones are dimensions, and the blue ones are metrics. This distinction is important when creating custom metrics.
Quick Reminder:
- Dimensions are descriptive attributes, like country, campaign, or marketing channel.
- Metrics are always quantitative, meaning they assign a value to a dimension or attribute, like unique users, conversions, or sales.
2. How to create a calculated field in your data source
To reach the screen where you create a calculated field, go to the sources you’ve added to your report (Resource → Manage data sources) and click Edit on the relevant source.
Once you’ve opened the list of dimensions and metrics, you’ll see a Add Field option at the top right. Select it, and then Add calculated field, it to access the screen where you can create fields.

You’ll see the available fields listed on the left. Green icons indicate dimensions, and blue icons indicate metrics.

3. How to create a calculated field in a blend
If you need more information on blends in Looker Studio, visit the post on the topic. But you can skip this for now and jump straight to the examples below.
The process described so far is for creating a field in a data source included in your report. If you want to create it in a blend, you must do so in the chart’s set-up column that uses the blend and where you want to show the calculated field.
By clicking on a dimension or metric, you’ll see the option to Add calculated field.


This brings up the screen where you can create the calculated field.

Note: When creating the field within the chart, you’ll need to do it for every chart where you want to use it, unlike with a data source field, which is reusable across charts.
4. Examples of custom metrics
Once in the field creation screen, you can select the fields from the left to add them to your formula. Click on the dimensions and metrics on the left to insert them into your formula.
Here are some common examples using Superstore Products data.
a. Price per product
Formula: SUM(Gross Revenue) / SUM(Quantity)

After returning to the list of fields, you’ll see a new blue field, indicating it’s a metric.
b. Costs
In some cases, transactions have negative net revenue, meaning the product’s costs exceed gross revenue. Let’s calculate the cost.
Formula: SUM(Net Revenue) + (-1 * SUM(Gross Revenue))

Again, you’ll see a new blue metric.
c. Price per Product (without discount)
If your dataset has a column for discounts applied to transactions, the gross revenue already accounts for this. So the previous formula calculates price per product after the discount. Here’s how to calculate it before the discount:
Formula: SUM(Price per Product) * (1 – SUM(Discount))
Got an error?

It’s normal if you couldn’t create it on the first try. The issue is that we’re applying an aggregation (SUM) to a metric, which already has an aggregation type.
Try removing the SUM. Does it work now?
Formula: Price per Product * (1 – SUM(Discount))

Remember, never use an aggregation inside a formula when working with a metric, which will be highlighted in blue.
d. Average Order Value
A common metric not included in this dataset is the average order value. To calculate it, sum the gross revenue and divide it by the number of unique transactions. Since each row is a combination of transaction and product name, use COUNT_DISTINCT
instead of COUNT
.
Formula: SUM(Gross Revenue) / COUNT_DISTINCT(Transaction ID)

Important Note: If there were only one transaction per row, you could use COUNT
, which counts total rows. But since transaction IDs repeat across rows, you need COUNT_DISTINCT
.
e. Net Revenue per Customer
You can also calculate net revenue per customer to compare it with the customer acquisition cost. If the first is lower than the second, the ROI is negative.
This formula is similar to the previous one. Since customer IDs can repeat across rows (a customer with more than one transaction), use COUNT_DISTINCT
to count unique values.
Formula: SUM(Gross Revenue) / COUNT_DISTINCT(Customer ID)

There are many more examples, but I hope these help you practice and create your own.
All the metrics we’ve created will appear at the end of your fields list in blue.

In the next post, we’ll look at how to change the data type of new or existing fields in Looker Studio. We’ll also review aggregation and comparison calculations that can be applied to metrics in charts, which sometimes avoids the need to create a custom field.
Let me know if you have any questions in the comments! 🙂