Use Parameters to change Column Dimensions in Google Data Studio
In this post I’ll show a method for using Parameters to change Column Dimensions in Data Studio.
Before we begin…
Before I begin I need to say that if you are interested in learning more about Parameters in Google Data Studio you read this article: Google Data Studio secondary dimension like inside Google Analytics by Mehdi Oudjida as it explains very clearly how to use parameters in Data Studio. I was familiar with parameters from Tableau but Mehdi’s blog posts helped me understand how to implement it properly in Data Studio. Also check out Mimoune Djouallah on Twitter who regularly posts innovative ways to use parameters in Data Studio. Also read up the official Google Analytics notes on Parameters in Data Studio.
Step 1: Create Two Parameters
In this example I’m using standard Google Analytics data from the Google Analytics connector in Data Studio.
The first step is to create two identical parameters. We will call these column_1_parameter and column_2_parameter.
Set up the list of values and display names identically.

For column_1_parameter choose Continent as the default value and for column_2_parameter choose Default Channel Grouping as the default value.

Step 2: Create Two Column Fields
The next step is to create two calculated fields based off each parameter.
Create a field called column_1_field where the formula is simply column_1_parameter. Likewise create a field called column_2_field where the formula is (you guessed it) column_2_parameter as shown below.

Step 3: Create Two Dimensions using CASE statements
The next step is to create two identical dimensions using CASE statements. Below is the CASE statement which you can copy and paste.
CASE column_1_field
WHEN 'Continent' THEN Continent
WHEN 'Country' THEN Country
WHEN 'Device Category' THEN Device Category
WHEN 'Default Channel Grouping' THEN Default Channel Grouping
WHEN 'Source' THEN Source
WHEN 'Medium' THEN Medium
ELSE "Other"
END
Below is what it should look like. Name them column_1_dimension and column_2_dimension.

Create two identical dimensions.
- column_1_dimension based on column_1_field
- column_2_dimension based on column_2_field
Once you’ve gone through this hellish ordeal of creating the two parameters, two fields, and two dimensions you should have the following new fields in your data source.

Now we can use them to create your Data Studio report!
Step 4: Building the Data Studio report
So the main purpose of having two column dimensions is that we can switch between them easily.
To enable this set up a table with Sessions as the metric. Then add column_1_dimension and column_2_dimension as the two dimensions for the table as shown below.

Add two filters to your report. I’ve used the Control Drop-down list type of control filter.
To filter column_1_dimension add column_1_parameter to the first filter.
To filter column_2_dimension add column_2_parameter to the second filter.

Below is a video showing how to use the two filters.
And below is the actual Google Data Studio report so you can play around with it yourself!
My Other Blog Posts
I hope you found this article about how to use Parameters to change Column Dimensions useful! You might enjoy my other blog posts.








Have you ever noticed that selecting a single option in a control list/filter doesn’t close the dropdown the way one would expect? 👻
Hi Michael,
thanks for this article – exactly what I was looking for, to build a dropdown to change the displayed Date-grouping of my GA-chart by “Date”, “Week”, “Month” and “Year”.
I had to figure out a few little things because I did not use a 2 column solution as you described.
My big issue: my GA resource is “blended” – and I couldn’t find a way to add the dynamic Paramter to my blended resource… quite a bummer in the end, to find out the whole thing does not really work across my blended resource…
Do you have any ideas, how I could get this to actually work on a blended resource?
Regards,
Oliver
Hi Oliver,
I haven’t used parameters with blended data I’m afraid. Hope you figured out a way to make it work?
Is there any way to get the names in the column of in the table itself, and not just on the filter?
Hi Mayank, sorry I’m not 100% sure what you mean?
Does anyone know how to do this same thing but to show different metrics in a table? Step 3 won’t work for me as Data Studio says I’m trying to combine dimensions with metrics when I use a dimension field in the CASE condition to display different metrics… Any ideas?
Hi, I want to ask if there is possibility to compare Sessions column with previous date period? Because I use same table in my report, where I can change column dimension and have some metrics. It works fine, but I want to see comparison to previous date period and Data studio return only System error without any details on my table. I think that is caused by parameter, because in other tables without column with parameter it works.