Help center

Go to Porter Metrics

How to create Filters and Controls on Google Data Studio

Input box and advanced filter

Input boxes and advanced filters let you have a search filter based on a string you add.

They’re way ideal when you want to filter specific data when a dimension has many string values.

For instance, you may want to visualize a table with the keywords your website ranks for that only include the name of your brand.

Or you want to see a list of your best-performing web pages whose URL contains /blog/ so you can make sure you’re filtering blog posts.

Their setup is quite simple as you only need to choose a single dimension, just like shown below.

Yet, we can do some customizations in the Style tab.

With the input box, you can choose if you want to display a dropdown or a fixed search bar. You can also display the search type you want to set.

For this exercise, which you can find on the Google Data Studio tutorial template on the Controls and filters page, we’ll test input boxes and advanced filters with a table whose data source is the Google Analytics sample account, and the dimensions are Page title and page (for URL).

Equals: this is the most restrictive rule of all. If we type the word “Home”, the table will only display results where the page title is exactly “Home”.

  • Contains: this search type is the most common as it is more flexible for your queries. It lets you filter your data if the string you apply is contained anywhere in the values. So, if we use it with “youtube”, the table will show all the pages where the word Youtube is shown somewhere in the URL.

  • Starts with:

  • REGEX: you can run regular expressions on Data Studio, like if you used SQL. we’ll see this feature later in this tutorial.

  • IN: the IN operator lets you set multiple conditionals that can match your condition. It’s like an OR.

Add a filter

While controls are external—they’re widgets displayed in a dashboard—, filters are internal and unique to each visualization.

Filters, therefore, let you clean the data for each chart, and cannot be modified by end-users.

The logic is the same, but their use case is different.

For instance, we have a customer who always wants to exclude Sundays on their traffic data. Sundays are irrelevant for them and don’t even want to waste time filtering them with a control.

Or, as I mentioned before, we always want to filter the traffic of a webpage that drives no value to our business.

To create filters, you should click on each visualization and scroll down to the button of the data setup options.

For this exercise, I will create a bar chart to display website traffic broken down into the dimension Mobile Device Branding, which will show the brands of the mobile devices people use to access our website.

There, you will click on Add a filter.

In this case, I will name the filter “Exclude Apple”.

I will follow these parameters:

  • Filter type: Exclude

  • Select a field: Mobile Device Branding

  • Select condition: Equals

  • Value: Apple

Once applied, our bar chart won’t show Apple in the bar chart, and you can save this filter for other charts.

Let’s do another example. I will visualize US traffic over time.

So, we’ll create a time series whose metric is Users and dimension is Date.

Now, let’s create a filter to include US traffic only, by following these parameters:

  • Filter type: Include

  • Select a field: Country

  • Select condition: Equals or Includes

  • Value: United States.

You’ll see other filter types like RegExp Match and RegExp and Is Null, which we’ll cover later.

The conditions that Google Data Studio displays vary based on the type of data of a field.

If you wanted to filter by dates, the conditions would be:

  • Equal to (=)

  • RegExp Match

  • RegExp Contains

  • Between (>= && <=)

  • Greater than or equal to (>=)

  • Greater than (>)

  • Less than or equal to (<=)

  • Less than (<)

If we wanted to exclude black Friday or Thanksgiving it would be like this:

  • Filter type: Exclude

  • Select a field: Date

  • Select condition: Between (>= && <=)

  • Value: 26/11/20

Just as a final example, you can also filter strings, like filtering by email or URL.

You may filter pages whose URL contains /blog/only to visualize blog traffic or exclude Gmail, Hotmail, and Yahoo emails in your contact list to only show business emails.

Heads up: in the filter section, you can also choose AND/OR conditions to add multiple rules.

Drill downs

Both drill-downs and optional metrics let you do more with your visualizations. They let you interact with your charts to modify their queries.

As you get more familiar with Google Data Studio, your users or you would like to ask more questions about your data—and create more charts.

Drilldowns let users interact with charts to toggle between different dimensions.

Let’s start with a time series.

Create a time series where you display website traffic by day with the Google Analytics sample connector, just as shown below:

Set Date as time dimension and Users as the metric.

Once you enable Drilldown, it will display other time dimensions such as Year and Month of Year.

Go to the view mode to see how they work.

Hover on the time series chart, and you will see arrows in the top-right corner.

Click on them, and your charts will change their time dimensions to display users by month and by year.

If Google Data Studio didn’t offer drill-downs and users wanted to display their data by date, month, and year, they would need three separate charts.

With drill-downs, you can get more charts without creating them or crowding your report.

If you go back to the edit mode and click on the chart, you could select other time dimensions like the day of week or week of the year to add them to the drill-down.

Drilldowns don’t only work with time dimensions, but with breakdown dimensions for charts like tables and pie charts.

Let’s create a pie chart whose dimension is User type—which breaks down your traffic by new and recurrent users—, and Users as the metric.

Once you enable the drill-down, you may choose more dimensions, like Gender.

When going back to the view mode, you will see that you can break down users by both User type and Gender without creating two pie charts.

Optional metrics

Just like you can toggle dimensions to break down your data, you can toggle metrics to change the queries within the same visualizations.

To “turn on” the optional metrics, click the switch below the metrics setup on any chart. You can use the same time series and pie charts we used for learning drill-downs.

Once you choose some optional metrics, you will go back to the view mode and see a graph icon to switch metrics.

Interactions: apply filter

The last way we want to share to make your Google Data Studio contextual and interactive is enabling the option Apply filter, found at the bottom of all charts setups:

I will enable it on the pie chart we’re using for this exercise and then go to the view mode.

Now, click on any of the values and you will see that all the charts in your dashboard will be filtered by the value you clicked. In this case, we’re filtering to only include traffic from women (Gender: Female).

If you want to get to know more about how to create a filter or control in Google Data Studio, watch this Google Data Studio tutorial. You will be able to get everything you need to know about filters and controls. In 6 minutes, you will learn:


1. How to clean your data
2. Use dropdown lists
3. Search Bar
4. Date Range Control
5. Internal Filters

Did this answer your question?
😞
😐
😁