Have you ever wanted to display different metrics in the same visualization without having to reconfigure it? If so, you've most likely had to resort to the optional metrics.
Whether you knew them or not, today we are going to see an alternative way to implement a more visual and intuitive metrics selector. To do this, we will use the lookerstudio parameters.
Once inside looker we will have to modify the data source and add a parameter. This can be done from the main menu "Resource" > "Manage added data sources" > "Edit" (of the respective connection) > "Add a parameter" (upper right).
Alternatively we can also open the "Data" side menu and click on "Add a parameter" at the bottom.All data sources are added to the "Data" side menu.
Once inside, it is time to set the parameter name and configure it. Below we represent an example of how to carry out this configuration:
Next we will have to create a new field, a metric, in the same data source that we have created the parameter. Starting from the structure shown in the image below, you just have to change the value "metric_param" by the name of the parameter you have created and update the metrics, also according to the ones you have in the parameter.
Once these steps are completed, the only thing left to do is to add the visualizations and configure them.
In this case we will use a line chart, changing the metric that appears by default for the metric that we created in the previous step.
We then add a line chart with the metric we created in the previous step.
Next we add a "fixed-size" control, like the one shown below, on the right side of the visualization. We change the "Control field" to the previously created parameter and group both elements together to prevent this filter from acting on other dashboard elements.
And that's it! Now you can access the preview mode and try the result.
With these steps, you will have a more visual and intuitive metrics selector in Looker Studio.