Data Studio: How to apply the same filter across multiple data sources

One issue that you may have met in Data Studio, when working in reports with multiple data sources is filtering of similar data. You may have the same column (eg. country) in both data sources with the same contents, but creating and applying a filter for one of them, does not filter the others. So you have to reside to non optimal solutions such as using a second filter control for other components of the report.

The reason that this is not optimal should be obvious: imagine an example with 2 tables sourcing data from different systems (eg Google Analytics and internal CRM) where you want to filter users by country. You would have to create 2 filter controls in your report and anytime you needed to switch countries you would have to select the appropriate country in one after the other.

Luckily, there is a workaround for this, based on custom fields. When you create a custom field in a data source, you will notice that Google provides you with an ID for that field.

custom field ID in Google Data Studio

Unfortunately this is not the case with default (non custom fields). If your data sources are “default” (meaning as the relevant source provides them), in order for the following workaround to help, you need to enrich them with a custom field (on each data source). You may perfectly well just replicate the column you want “as is”. You will have 2 fields with the same values in each of your data sources, but I guess you can live with that. The gains from not having to work with multiple silly filters in your report, will compensate you. A simple way to achieve that for example if we are talking about a text field, is to use this formula for the custom field that copies it:
CONCAT(source dimension,”). (eg CONCAT(country,”). Then copy the field ID that Google gave to your new custom field.

Next step is to go to your other data source and do the same. Just be careful, the first time you create the dimension on the second data source, you will have your only chance to use the same field ID. Google will auto provide you with a different field ID, but the first time you are creating it, the actual field ID is editable!

field ID on a new calculated field is editable on create

Use this chance an past into the field ID the field ID you copied from the previous data source. You are set! From now on, any filter control that you will enter on the report that uses an of those calculated fields, will control and filter data across your data sources!

PS: It goes without saying, that the actual data in the columns need to match as well, at least for some of the records, for this workaround to be meaningful. Eg if you create 2 custom country fields and you try to filter by country = Greece, while the second datasource does not have Greece as a value in the custom field, then it will not make sense to have it.

Leave a comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.