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’

An image of a CASE statement used to adjust Dimensions in Google Data Studio

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.

Showing how to create a fake Table header to adjust Dimensions in Google Data Studio

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.

A CASE statement in Google Data Studio.

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.

A gif showing how to adjust Dimensions in Google Data Studio by clicking on the left hand table.

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!

Michael Howe-Ely