How to Use Calculated Fields in Looker Studio
Your Looker Studio dashboard shows you what’s happening, but sometimes your connected data sources - like Google Analytics or Google Sheets - don't contain the exact metric you need to see why it's happening. Calculated fields are the solution. This article will walk you through how to create custom formulas directly inside Looker Studio to clean your data, calculate custom KPIs, and uncover deeper insights without ever leaving your report.
What Are Calculated Fields in Looker Studio?
Calculated fields are like formulas in a spreadsheet. They let you take one or more existing fields (called dimensions and metrics) from your data source and use functions, math, or logic to create a brand new, custom field. You’re essentially creating new information from the raw data you already have.
For example, if your data source has a "Revenue" metric and a "Transactions" metric, you could create a calculated field to divide them and produce a new metric for "Average Order Value." This new AOV metric doesn't exist in your original platform, but you can create it on the fly within your Looker Studio report.
You can use them to:
- Perform mathematical calculations: Calculate profit margins, conversion rates, cost-per-acquisition (CPA), or return on ad spend (ROAS).
- Manipulate text: Combine a "First Name" field and a "Last Name" field into a "Full Name" field, or clean up messy campaign names by making them all lowercase.
- Add logical groupings: Use CASE statements to group countries into sales regions (e.g., "USA" and "Canada" become "North America") or categorize content based on URL slugs.
- Transform dates: Extract the day of the week or month from a full date to analyze performance trends over time.
Chart-Level vs. Data Source-Level: Which Should You Use?
Before you create your first formula, you need to decide where it will live. Looker Studio lets you create calculated fields in two places, and each has its own unique advantages.
Chart-Level Calculated Fields
A chart-level field is created directly on a specific chart or table in your report. You can create one by clicking "Add a Metric" or "Add a Dimension" in the chart's setup panel, and then selecting "CREATE FIELD."
- Pros: Quick, simple, and perfect for one-off calculations or experimenting with a new idea. It doesn’t clutter your main data source with fields you might only use once.
- Cons: The field only exists in the chart where it was created. If you want to use the same "Average Order Value" calculation on three different charts, you have to create it three separate times. Also, you can’t use a chart-level field in report-wide filters or controls.
Data Source-Level Calculated Fields
A data source-level field is added directly to the data source's structure. You create it by editing the data source itself and clicking the "ADD A FIELD" button.
- Pros: Reusable and consistent. Once you create it, it's available as a standard field in every chart that uses that data source, just like any native dimension or metric. You can also use it in filters, controls, and even in other calculated fields.
- Cons: It takes a few more clicks to set up. It’s slightly more "permanent" and will appear in the field list for anyone using that data source in the report.
Our recommendation: For metrics that are core to your business (like Conversion Rate, AOV, or custom goal completions) and you'll reuse across your report, always create them at the data source level. For quick, one-time questions or tests, a chart-level field is fine.
How to Create a Data Source-Level Calculated Field (Step-by-Step)
Let’s walk through a common real-world scenario: calculating your website's overall Conversion Rate using data from Google Analytics 4. GA4 gives you Conversions and Sessions, but there's no pre-built "Conversion Rate" metric for this specific calculation.
Here's how to build it:
- Navigate to the top menu and select Resource > Manage added data sources.
- Find your Google Analytics data source in the list and click the EDIT action on the right.
- This will open the data source editor. In the top left corner, click the blue button that says (+) ADD A FIELD.
- You'll now see the calculated field editor. Let’s configure it:
- Check for a green checkmark below the formula box, which confirms your syntax is valid.
- Click the blue SAVE button in the bottom right corner.
That's it! Your new "Overall Conversion Rate" metric now appears in your field list with a small fx symbol next to it, and you can drag it onto any scorecard, table, or time-series chart in your report.
5 Practical Examples of Calculated Fields
Formulas can be as simple as division or as complex as nested logical statements. Here are five very practical examples you can adapt for your own reports.
1. Grouping Content with the CASE Function
Let's say you want to see how your different types of blog content perform, but your URLs are your only indicator. You can use the CASE statement to create a "Content Group" dimension.
- Goal: Categorize pages into groups like "Blog," "Landing Pages," or "Help Center" for high-level performance analysis.
This formula checks the Page path dimension. If it contains "/blog/", it assigns "Blog Post," if it contains "/help/", it assigns "Help Article," and so on. Anything that doesn't match is labeled "Other Pages." This is perfect for analyzing a whole category instead of individual pages.
2. Combining First and Last Names with CONCAT
If you have HubSpot or Salesforce data with separate "First Name" and "Last Name" fields, it's often more useful to see them as a single "Full Name" in your tables and reports.
- Goal: Create a single
Full Namefield to use as a label in lead and deal reports.
The CONCAT function simply merges text fields together. Here, it takes the First Name field, adds a space (" "), and then adds the Last Name field.
3. Cleaning Up Messy UTM Campaign Names
Data entry isn't always perfect. Maybe one person on your team uses "Summer Sale" for a UTM tag, another uses "summer_sale," and another uses "Summer_sale". These will appear as three different campaigns in your reports. The LOWER function helps fix this.
- Goal: Standardize campaign names by converting them all to lowercase so they are properly grouped.
This creates a new dimension, Clean Campaign Name, where all values are completely lowercase. Now, "Summer Sale" and "summer sale" will both be treated as the same thing, giving you accurate data.
4. Calculating Cost Per Click (CPC)
If your advertising data source (like data imported from Facebook Ads or LinkedIn Ads via a Google Sheet) provides Cost and Clicks, you can easily calculate CPC.
- Goal: Monitor the click efficiency of your advertising campaigns.
- Make sure you set the Data Type to Currency so the output displays correctly.
5. Dynamically Flagging High-Value Customers
Imagine you want to create a dimension that tags customers as "High Value" if they've spent over a certain threshold, like $500, from your Shopify or Stripe data.
- Goal: Create a simple customer segment to analyze the behavior of your best customers.
You can then use this new dimension in charts to see which channels or campaigns bring in the most "High Value Customers."
Final Thoughts
Calculated fields transform Looker Studio from a simple data viewer into a flexible analysis tool. By learning to write a few basic formulas, you can customize your reports to answer very specific business questions, harmonize messy data across different platforms, and create KPIs that truly reflect what matters to your organization.
Of course, becoming proficient with formula syntax and data architecture takes time and practice. At Graphed , we’ve baked this kind of powerful logic directly into our tool, but you access it through natural language. Instead of writing formulas, you can just ask questions like "create a dashboard comparing campaign cost versus revenue from Facebook Ads" or "what is my average order value by traffic source this month?" Our AI connects to your data, builds the dashboard live, and saves you from the manual work of pulling data and crafting formulas.
Related Articles
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.
How to Create a Photo Album in Meta Business Suite
How to create a photo album in Meta Business Suite — step-by-step guide to organizing Facebook and Instagram photos into albums for your business page.