How to automatically adjust Dimensions in Google Data Studio
In this post I’ll show you have to automatically adjust Dimensions in Google Data Studio.
What I mean by this is that I’ll show you how to set up a custom Dimension that changes based on another dimension.
I have to admit I wasn’t clever enough to think this up on my own, and saw the brilliant Mehdi Oudjida show the method on Twitter.
Follow him on Twitter for great and original Google Data Studio tips and other great advice. Or why not visit his website!
I thought the method he showed was really cool, and wanted to write it out in a blog post so I wouldn’t forget it.
Below is the Data Studio based on the method.
How to automatically adjust Dimensions in Google Data Studio
Creating this Data Studio involves adding two custom Dimensions. Both of these are created using CASE statements.
Creating the first CASE statement
The first I call ‘Selected Channel Detail’
Below is the CASE statement that we will use for the right-hand table.
CASE
WHEN Default Channel Grouping = 'Direct' THEN Source/Medium
WHEN Default Channel Grouping = 'Organic Search' THEN Landing Page
WHEN Default Channel Grouping = 'Paid Search' THEN Campaign
WHEN Default Channel Grouping = 'Referral' THEN Source
WHEN Default Channel Grouping = 'Social' THEN Social Network
ELSE Source/Medium
END
Creating the second CASE statement
Next, we will create a second CASE statement. It is very similar and I call it ‘Channel Detail description’.
I’ve created this to create what looks like the table header, but is actually a separate table, as shown below.
So if we’ve chosen to view the Channel ‘Social’ the ‘Channel Detail description’ table will display the chosen dimension. In this case ‘Social Network. Then in the table below the actual Social Networks will be displayed.
The CASE statement below is very similar to the previous one, but instead of using actual dimensions it just says the name of those dimensions.
Below is the CASE statement if you’d want to copy and paste it.
CASE
WHEN Default Channel Grouping = 'Direct' THEN "Source/Medium"
WHEN Default Channel Grouping = 'Organic Search' THEN "Landing Page"
WHEN Default Channel Grouping = 'Paid Search' THEN "Campaign"
WHEN Default Channel Grouping = 'Referral' THEN "Source"
WHEN Default Channel Grouping = 'Social' THEN "Social Network"
WHEN Default Channel Grouping = 'Email' THEN "Source/Medium"
ELSE Source/Medium
END
After adding in these two CASE Statements we can see the Dimensions in the right-hand table change according to which Channel we select in the table on the left.
Hoped you found this article about how to automatically adjust Dimensions in Google Data Studio useful!
My Other Blog Posts
If you liked this article you might like my other blog posts.
Or you can follow me on Twitter!
Thank you very much for the reference and your recommandations 😉 I appreciate.
My pleasure! 🙂
Hello, Michael, I don’t understand, how to create a link between these 2 tables. I’ve created 2 case statements, but how to apply them? Help, pls.
Hi Andrey. Ok, I guess it is not as clear as it should have been. When I have some time I will add more info. Basically the one CASE statement changes the Dimension in the Table based on what Dimension you choose in the left-hand filter. Eg Choose Social on the left and the right becomes ‘Social Network’. The second CASE statement just creates the Name of the chosen dimension for the right hand table.
I missed the main tip: activate the “Aplly filters” option in the table on the left. Only then will there be the “link” between this table and the other elements of the page.