Learn BI online

View Original

Parameters in Google Data Studio

See this social icon list in the original post

This video is taken straight out of my online course, The Ultimate Guide to Google Data Studio. Head on over to see a full preview of the course.

Below is the transcript of the video so it’ll make much more sense if you watch the video first :)


Parameters are a relatively new addition to Data Studio having been released on the 20th of August 2020. They can be used in calculated fields and allow users to select a value, either numeric or text, that will then impact the result of the calculated fields it’s included in. You’ll more often than not use them with numeric type calculated fields so I’ll start with this. To give you more context with a typical use case, let’s imagine that our shipping cost is based on the price of a litre of petrol (or a gallon of gas if you’re in the states). We’d like to know how much our shipping cost would increase if the price of petrol went up by a particular percentage.

If we think about the logic for a second. We would need to be able to multiply our shipping cost metric by a variable number. This variable being chosen by the viewer. So let’s create our variable (or parameter) first.

At the bottom of the schema on the right of the Data Studio report builder, you can click to add a parameter which brings up the Parameter builder window. Give it a relevant name but remember that you could potentially use the same parameter for more than one situation, so best to give it name more closely related to its properties than the calculated field you’re using it for currently. Data Studio creates a parameter ID but you can modify that if you wish. For our example, the data type is going to be “Number” and I’m going to select “Range”, to limit the values that can be used in the parameter. Minimum will be zero and maximum will be 3. The default value I’m going to set to 1, and you’ll see why in a second. I’ll then Save and click “Finished”.

You will then see that your new parameter has been added to the bottom of the schema and it’s coloured purple. The next step is to create a new calculated field that uses this new parameter and multiplies it by our shipping cost. So I’ll add a field and call it “New Shipping Cost’. The formula will be SUM(Shipping cost) multiplied by Variable1. Save and Finished.

On the report, copy and paste the scorecard to duplicate it and add our new calculated field. You can see that the 2 values are the same. This is because the New Shipping cost is being multiplied by our parameter whose default value is set to one. So Shipping cost times 1.

The final step is to add a control to the report that will contain our parameter and let our viewers change the value. Let’s add a slider and go into view mode. So, we can move the slider from left to right between the values we set (0 and 3) in increments of point one. If we want to know what our shipping cost would be after a 20% increase, I set the value on the slider to 1.2 and the new shipping cost will be calculated. But perhaps we’d also like to see the amount that this increase represents? Let’s go back into edit mode and I’ll create a new calculated field that we’ll call “Shipping increase”. The calculation will simply be sum(new shipping cost) minus sum(shipping cost). Save. We’ll duplicate another scorecard and add in our new field. VIEW MODE. We can now also see the amount increase when we select a value using the slider.

Ok, so we’re not going to go any further with parameters in this course because, as I said, you will mainly be using these number type parameters that we’ve just seen and to go any further, in my opinion, won’t be worth it in terms of the potential confusion it could cause.


So that was a video from our brand new online course, The Ultimate Guide to Google Data Studio. It’s updated on a monthly basis to include all of the new developments and functionalities. Head on over to Vitamin BI Education to find out more and see a full preview of the course

See this form in the original post