Google Data Studio

Google Data Studio chart highlighter

Conditional formatting is typically a very good automatic highlight system for dashboards to read fast and see what it is the more important.

On the other hand, Google Data Studio can be also used for manual reports and data viz for analysis exposure, (and why not during a presentation meeting) requiring to highlight manually but dynamically a part of chart based on dimension and comment it.

So, for that kind of cases, let’s build this simple system I called “chart highlighter”.


Google Data Studio chart highlighter

Getting the capability to highlight manually a part of a chart means also getting the opportunity to afford the luxury to design in a neutral way what should be more in the background of the data story.

So, let’s take this opportunity to apply a best practice of story telling and data visualisation : “one by one message, one by one thing, one by one highlight”…

…Highlighting everything is equivalent to highlighting nothing…yes, it is obvious but to apply it, we need to built required means inside our data viz tool.


The result

So, what would be the best available feature inside Google Data Studio to inject external data context (not directly correlated to your data) and the related interactive control? Parameter! Of course.

Let’s review the result covering some use cases of dimensions and charts.



Ingredients for country chart highlighter

The following paragraphs will focus on the country chart highlighter but you can apply exactly the same system for the other use cases, reviewed in the video above. As usual, for this article, I use Google Analytics demo data from Google Merchandise store.

Following the feedback for this article and concerning the other use cases, I will add elements more specific for dates management and check boxes

So, to build the country chart highlighter, we will use the following native features provided by Google Data Studio:

  • Data source parameter & the corresponding input box
    To fill the wished highlighted dimension value and compare it to our data
  • Calculated fields
    To isolate the highlighted data on a specific dimension value, also to display our highlighted value in a tiny recap
  • Charts
    To display our data, we use charts configured with our calculated fields
  • Dimension value colors
    To apply a shiny color to highlighted data and a neutral one to the rest

Data source parameter

Let’s create a parameter inside our data source to store and take in account the country filled through the input box control of the chart highlighter:

  • Name : Country highlight
  • Parameter ID : country_highlight
  • Data type : Text
  • Permitted values: Any value
  • Default value: United States
    (take care of the case, respecting exactly the dimension value, for this project, I don’t multiply fields to manage case insensitiveness)

Google Data Studio - Chart highlighter - Country parameter

Calculated fields

Now, we need 2 calculated fields.

First, a wrapper of the parameter previously created. This time, we don’t need it for formula evaluation without error as we saw in a previous article, but just to use it as a label in the reporting, as a highlighter legend.


Country highlight - param wrp
Country highlight

Then, we create a dimension that will split metrics in 2 groups:

  • “Highlighted” : All data corresponding to the value of the parameter
  • “Others”: The rest of data

This calculated field is named Country highlight – Highlighted or others and here is the formula with a classic case statement.


Country highlight - Highlighted or others
CASE 
WHEN Country = Country highlight THEN "Highlighted"
ELSE "Others"
END


Input box & highlighter legend

Now the configuration of the data source is finished, we add the input box and we select the parameter Country highlight as control field (Data tab) and adapt styles.

Then, we add where it is necessary (input box not visible), a table chart with one line, displaying Country highlight – param wrp dimension without metrics and with a light style and specific icon like in the demo.



Charts update

Our last actions are:

  • The change of the bar charts and Google Maps chart to drill down by Country highlight – Highlighted or others
  • The definition the good colors by value
  • And for bar chart, the display as stacked bars.

Let’s check the chart configuration in the video below.



Final thoughts

  • One time again, the same mechanism is used in the other examples with dates and traffic sources, there is just specificities about date fields management and boolean check boxes states. In the future, I will give details about these other use cases
  • The first time I use stacked bars as a trick to to display several colors in a bar charts was probably also the first time I shared someting about about Google Data Studio on Twitter. It is funny to re-use this it now in combination with parameter for other needs
  • When I build the dates highlighter, I thought about a lot of ideas around fill control, messages, advanced search and operator….probably it is a door opened for other incoming articles 😉

“Monique, tu me mets un coup de Stabilo sur les mots importants steup…”