Skip to content

How to make a dynamic dashboard using Google Sheets

Published:

Cascading Menus: The second drop-down (Country) updates based on the selection of the first drop-down (Region)

Imagine you are a start to mid-level analyst or manager at a highly data driven organization. Part of your routine work is to deal with the same set of data, churn actionable insights from it and report it to a broader team. If expensive BI tools like Tableau and Qlikview are overkill for your requirement, then read further.

With the power of Google Sheets, anyone can create functional and dynamic dashboards which can be shared with a number of people for consumption. In this tutorial, we will make a simple dashboard using google sheets.

Note: You can create a similar dash in MS Excel as well with slight modifications,
but we will cover the various excel equivalents for Google Sheets functions in a later tutorial. You can also use the powerful Pivot Tables to create similar summaries, however, those are limited in functionality and not ideal to share with others in form of an intuitive dashboard interface.

In this tutorial, we will learn the following:

Resources

Sample data

Courtsey E for Excel. Note that I updated the Order Date column to more recent dates.

Final Dashboard

In Google Sheets

List of major functions we will learn about:

Getting Started

Define Values, Dimensions and Filters

For the rest of the tutorial, we will use the following terms:

Pro Tip: I prefer to use a consistent color scheme for all input cells.
In this case the only “inputs” by a user are the values of the drop-down filters (Region and Country). Hence they are color coded in mild yellow to let the user know that it can be changed.

Once we have created a basic structure for your dash, we move to the fun stuff, creating cascading menu drop-downs for your filters.

Creating cascading drop-down menus

=SORT(UNIQUE(DATA\_RAW!$A$3:$A$2002),1,TRUE) // first takes unique values from range DATA_RAW!$A$3:$A$2002 and then sort the results in alphabetical order

Puzzled by the varied use of the $ dollar sign in the formulas?
Read more about cell referencing in Google Sheets here

The last step is to populate these results in our Region drop-down on cell D3. For this, we select the cell D3, go to Data > Data Validation, under Criteria, select List from a range, and select the the entire range of values in Column A (‘Summary’!A5:A100). Make sure the “Show drop-down list in cell” option is checked. Once done, the list will start appearing in in cell D3 as a drop-down. Notice that blanks are ignored in the drop-down list and it shows up in same order (Alphabetical). Now, we use a similar formula to populate the values of our second drop-down (Country) in cell B6 of the summary sheet, but with one major difference: The values for Country drop-down should change based on what is selected in the Region drop-down. For this, we make use of the FILTER function. The sequence is as follows: First we filter for Country column values in RAW_DATA sheet conditional on the values in the Region column on the same sheet. Once we have the filtered Country values based on our selected Region, we apply the functions similar to our previous step to make our results unique and then sort them alphabetically Finally, for completeness I wrap our output inside an IFERROR function to ensure the Country list does not throw a Filter error when “ALL” is selected under Region. In case of such an error, I make the Country list empty. I also add a “ALL” static value in cell B5 (will come to its use later)

=IFERROR(SORT(UNIQUE(FILTER(DATA_RAW!$B$3:$B$2002,DATA_RAW!$A$3:$A$2002=$D$3)),1,TRUE),"")

// Select Country input values (DATA_RAW!$B$3:$B$2002) ONLY if the corresponding Region input values (DATA_RAW!$A$3:$A$2002) are equal to our currently selected Region in Summary ($D$3)

Now we again follow the steps similar to the Region drop-down, and use data validation to populate the Country drop-down in cell E3. Viola! we have the cascading drop-downs working, with the Country drop-down values changing based on the Region drop-down values.

Dynamically populating the dimensions (row and column headers)

Our original selection for row headers was Item Type and for Column headers was the Week containing the Order Date (A week is represented by the date on Monday of that week). Although for simple summaries where the dimension values don’t change, we can just manually populate static values for the two dimensions. However, for this exercise, I want both the dimension values to be dynamically populated from RAW_DATA For row headers, we use the same UNIQUE and SORT functions (refer to the previous cascading menu step) to populate all unique values of Item Type from RAW_DATA and also sort them alphabetically. For column headers, I want to populate the latest 4 weeks of data based on the Order Date in RAW_DATA.

In cell H5
=MAX(DATA\_RAW!$F$3:$F$2002) - WEEKDAY(MAX(DATA\_RAW!$F$3:$F$2002),3)

// MAX function pulls the largest date value (most recent) from
the range DATA_RAW!$F$3:$F$2002. Then we use the WEEKDAY function to subtract the number of weekdays past since Monday of that week. This way we always end up with the Monday of the week of Order Date, regardless of the date

Aggregating data based on your filters and dimensions

Finally, we use the versatile SUMIFS formula to conditionally sum the Units Sold column from RAW_DATA sheet. The conditions are applied on Region, Country, Item Type and Order Date SUMIFS in its simplest form is very simple to understand. Taking our example, we enter the following formula on cell E6 in Summary:

In Cell E6
=SUMIFS(DATA_RAW!$I:$I,DATA_RAW!$A:$A,_$D$3,DATA_RAW!$B:$B,_$E$3,DATA_RAW!$C:$C,$D6,DATA_RAW!$F:$F,">="&E$5,DATA_RAW!$F:$F,"<="&E$5+6)

The above formula explained in English is as follows: SUM the values in range DATA_RAW!$I:$I ONLY for selected rows where

Final touches to make the interface more user friendly

Using “ALL” option to select all Regions and/or countries:

In cell E6
=SUMIFS(DATA_RAW!$I:$I,DATA_RAW!$A:$A,IF($D$3="ALL","\*_",$D$3),DATA_RAW!$B:$B,IF($E$3="ALL","\*_",$E$3),DATA_RAW!$C:$C,$D6,DATA_RAW!$F:$F,">="&E$5,DATA_RAW!$F:$F,"<="&E$5+6)

Add additional conditional formatting to highlight errors in drop-down values. In our example, if the user enters a value which is not part of the drow-down list, the color of the drop-down will turn from mild yellow to red to highlight the error.

Before sharing your new dashboard with others for consumption, you should protect the sheets so that other users cannot modify any formulas in the sheet. While you are protecting your sheet, add the Filter drop-down cells (D3 and E3) under exceptions (Except certain cells). This way, the only cells the users can change in the sheet are the ones that you want them to change. You can add more summaries of different values and dimensions. Some ideas based on the data in current example are:

I hope this tutorial was useful and easy to understand. For any questions or feedback, you can comment on this post below.

~ Fin ~