How to build a control that filters across several data sources in Looker Studio?
Learn how to filter across several data sources using only one control in Google Looker Studio. One hint, it has to do with field ID…!
This is an issue that many people face pretty early during their Google Looker Studio (previously known as Data Studio) journey (and the reason why you’re here today).
Looker Studio connectors we use on a daily basis and are happy with (w/ free trials): Supermetrics - Windsor - Catchr - PMA - Funnel
Not sure which one to pick? Reviews here and there. Still unsure?! Contact us with your tech stack and budget, and we’ll guide you in the right direction:
Let’s say that’s you’ve got two data sources sharing a field which is not a date (in this case, the default Date Range Control does filter across several data sources, bad example!). Maybe one data source is a simple GA4 property, and the other is your Search Console connector (but really works with any data sources, any field, as long as they’ve got the same format). They both offer a Country field.
Here, I’ve got two tables, left are yesterday’s sessions from GA4, and right, my impressions in Google Search, both split by Country:
Now, what if I wanted to add a Control to be able to filter by Country?
Well, pretty straight-forward, I click Add a Control in the top ribbon, select Drop-down list, choose my Search Console connector as data source, choose Country as my Control Field, set it to United States, and this is what I get:
My Search Console table gets updated, but not my GA4 one. Similarly, if I were to switch the data source to the GA4 one, left table would get updated, right table wouldn’t. So what can we do here to ensure both tables get updated?
Add fields with the same field ID to filter across data sources
Now, this is where the magic happens. Edit the first data source (top ribbon, Resource, Manage added data sources, Edit). Then, Add a field, and set it up as follow:
Do exactly the same things on the second data source. At this stage, you should have two fields with the same field ID (filter_country here, in reality field name does not matter), so now if one gets filtered, the other gets filtered as well. Why? Because they share the same field ID. This is what you need to remember today. Same field ID, same field for Looker Studio, if you filter on one, you filter on the other as well.
You can give it a try by changing the Control Field in your Control, replacing country by filter_country and selecting Spain this time. Boom, it’s somewhat working:
Why am I stating it’s only sometimes working? Because we are indeed filtering on Spain in both tables, but the list of countries being different between the 2 data sources, the drop-down list is not offering me the full list of options. It only offers the options available in the choosen data source.
We wrote another article to explain how to show the right list.
And that’s it. We managed to filter on a field across data sources. We did it with 2, but if you get the point, you can do it on 3, 4 and more data sources, sky is the limit!
PROBLEM ALMOST SOLVED !
Tools we use and we like:
Todoist: for tasks management
Monday: for projects management, when tasks fall short
Tropical Server: our friends in charge of the hosting of this very website!
Tools we’d like to use (if we had the budget…):