Get your free Looker Studio crash course!

How to use Conditional Formatting in Query Result Variables in Looker Studio

If you’ve been exploring the new Conditional Formatting in Query Result Variables feature in Looker Studio (also known as chips), you already know how much it can transform storytelling. Query result variables let you embed live metric values directly into text, so instead of writing “Top category is…”, you can write:

“Top category in California: Technology”

and the result updates automatically every time your data refreshes. With the addition of conditional formatting, those dynamic values can now visually reflect performance too, changing colour when they cross a threshold, highlighting growth, or reverting to neutral styling when they fall below expectations.

In this guide, we’ll walk through a real, practical example using the Superstore Products dataset. You’ll see how to highlight the top category by gross revenue in California, make it turn green when revenue is high, and watch it update dynamically when you filter by year.

Why Conditional Formatting in Query Result Variables matters

Until recently, query result variables were static. They displayed real-time data, but they always looked the same. Now, you can add an extra layer of context by making them change visually as the data changes. That means you can:

📊 Spot key insights at a glance – Colours show whether a KPI is strong, weak, or on target.
🚨 Highlight underperformance – Values below expectations stand out instantly.
🎨 Tell stronger stories – Styling draws attention to what matters most.
Automate formatting – Once set, the styling updates automatically whenever the data changes.

Step 1: Create a query result variable

First, let’s build a variable that shows the top product category by gross revenue in California.

  1. Insert a text box in your Looker Studio report.
  2. Type @ to bring up the query result variable menu and click Add variable.
  3. Choose Category as the dimension and Gross revenue as the metric.
  4. Apply a filter for California.
  5. Sort by Gross revenue (descending) and set Row = 1 so the variable always returns the top category.

Result: The chip now shows the current top category:

Query result variables in Looker Studio

Step 2: Add conditional formatting

Next, we’ll make the variable visually reflect performance using Conditional Formatting in Query Result Variables.

  1. While editing the query result variable, click Conditional formatting.
  2. Choose Single colour.
  3. In Format rules, set:
    • Field: Gross revenue
    • Condition: GREATER THAN OR EQUAL TO
    • Value: 150000
  4. Choose a green background for when the condition is met.

Result: Because “Technology” has a gross revenue greater than 150,000, the chip now turns green:

Conditional Formatting in Query Result Variables

Step 3: Add a filter to make it dynamic

Now for the most powerful part: query result variables respond to filters, and conditional formatting updates automatically.

Let’s add a year filter:

  1. Insert a dropdown control and select Order date.
  2. In the control field, change Order date data type to Year.

When you select 2014, the query result variable recalculates. The top category now becomes:

But because Office Supplies generated less than 150,000 in gross revenue that year, the conditional formatting rule isn’t triggered, and the chip returns to its default grey background.

Dynamic behaviour:

  • Above threshold: highlighted green
  • Below threshold: neutral grey

Best practices for Conditional Formatting in Query Result Variables

🎯 Use consistent colours: Stick with familiar conventions (green = good, red = bad).
📊 Avoid over-formatting: Too many colours can confuse rather than clarify.
🧠 Set meaningful thresholds: Pick benchmarks that matter for your business.
🔁 Test with filters: Make sure your rules behave correctly when users change controls.
🧩 Use rules for alerts, scales for trends: Choose the approach that fits your KPI.

FAQs: Conditional Formatting in Query Result Variables

  • Q: Can I apply conditional formatting from the text properties panel?

    No, conditional formatting is available only when creating or editing a query result variable.

  • Q: Can the formatting rule reference another metric?

    Yes, you can compare against another field, such as a target value.

  • Q: What if multiple rules apply?

    The rule at the bottom of the list takes precedence.

  • Q: Can I apply conditional formatting to dimensions?

    Yes, it works the same way as applying conditional formating to charts.

Final thoughts – Conditional Formatting in Query Result Variables

The addition of Conditional Formatting in Query Result Variables turns Looker Studio chips into powerful storytelling elements. In our example, we didn’t just show the top product category in California, we also made its appearance change based on revenue and respond dynamically when the user filtered by year.

This feature makes dashboards more engaging, more informative, and far easier to interpret. Once you start using it, you’ll wonder how you ever built reports without it. 🚀

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top