ICAEW.com works better with JavaScript enabled.
Exclusive

Simple but effective Tables. Part 6 – Dashboards, a refreshing change

Author: Simon Hurst

Published: 03 Jul 2024

Exclusive content
Access to our exclusive resources is for specific groups of students, subscribers and members.

In this series we are going to examine some of the capabilities of Excel Tables. We will be concentrating on the practical use of Tables to improve spreadsheet productivity. The last article finished with a brief introduction to the use of Slicers as interactive filters for Excel Tables. This time we show how Slicers can be used in practice to create an interactive dashboard from an Excel Table.

Excel Tables – so much more than just a pretty format

When Tables were first introduced into the Windows versions of Excel in Excel 2007, many people saw them as another Excel formatting ‘gimmick’. This view was supported by the inclusion of the Format as Table command in the Styles group of the Excel Home Ribbon tab. However, it soon became apparent that Tables were much more important than that, and that they had a significant role to play in many aspects of automating Excel.

This is the story so far:

Having introduced Table Slicers in the previous article, this time we see how to put them to practical use as part of creating an interactive dashboard based on a Table.

Sliced Tables and charts

As we saw last time, when we add one or more Slicers based on a Table, selecting one or more items in any of the Slicers will hide any rows in the Table that don’t match all of the Slicer selections. If we base a chart on the whole Table, or on entire columns in the Table, then the chart will also be controlled by the Slicers:

Excel screenshot
This example demonstrates that our Item Slicer controls the contents of our Table and also the charts that are based on all or part of it. The example also shows an advantage of basing charts on Tables rather than PivotTables. The Treemap style chart cannot be based on a PivotTable, but can be used with a normal Table. However, if we look more closely at our Treemap chart we can see that, for it to work properly, we need to group the items in the range that our chart is based on.

One way of doing this is to use the new GROUPBY() Dynamic Array function that is currently available to those on the Excel ‘Insider’ update channel, and which we looked at very briefly in part 4 of this series. This time we have used a slightly more complicated form of GROUPBY() that groups our Table data by the Item and Colour columns and includes the column headers. Our fourth argument uses the value 3 to include those headers in our output range, with the 0 entered as the fifth argument removing totals from the output:

=GROUPBY(Sales[[#All],[Item]:[Colour]],Sales[[#All],[Price]],SUM,3,0)

Note that we have included our GROUPBY() formula underneath our Table of data for demonstration purposes only, it would usually be preferable to place it elsewhere.

We can base our Treemap chart on our GROUPBY() range but, although it will display the groups in the chart, it will ignore the Slicer settings, since all the rows are still part of the Table that the formula refers to, but are just hidden by the Slicer:
Excel screenshot
The solution to this is again something that we have covered before. We can add a column to our Table that uses the SUBTOTAL() or AGGREGATE() functions to differentiate between rows that the Slicer has hidden and those that are still displayed.

This use of the AGGREGATE() function uses the first argument of 2 to choose the COUNT aggregation, crucially the second is set to 5 to ‘Ignore hidden values’. The array to be aggregated is a single cell. Accordingly, the formula will return a count of 1 for visible rows only:

=AGGREGATE(2,5,[@Price])

By using a function that returns a value such as 1, we can use the column as a filter directly, without needing to compare it to any other value. Here is our ‘Sliced’ column added as the Filter argument of our GROUPBY() function:

=GROUPBY(Sales[[#All],[Item]:[Colour]],Sales[[#All],[Price]],SUM,3,0,,Sales[Sliced])
Excel screenshot

PIVOTBY() - so near?

You might think that the partner Dynamic Array function to GROUPBY(), PIVOTBY() would mean that we can add other exciting types of chart to our dashboard presentation and thereby avoid the need to use PivotTables, with their need for a refresh operation, entirely. However, there are a few reasons why this might not be the case. Firstly, only simple Slicers can be attached to a Table, whereas there is also a Timeline Slicer available for use with PivotTables. Secondly, Table Slicers can only be attached to a single Table whereas PivotTable Slicers can be connected to multiple PivotTables allowing data from multiple sources to be combined into a single dashboard.

Additionally, there is a problem with the way that PIVOTBY() operates which hopefully might be sorted out before its general release. Because of the way in which it works, PIVOTBY() leaves holes in the output range where any combinations of row and column have no values. This leads to unpredictable results with charts based on PIVOTBY():

Excel screenshot

It might look as thought it would be simple enough to replace the blank values with zeros, particularly as the aggregation function used by PIVOTBY() is a LAMBDA() function. Simple as it might be, the solution has eluded me so far. If you know the answer, please let us know via the associated post on in our LinkedIn group:

Next time…

Conclusion

You can explore Tables, Slicers, dashboards and a great deal more, in the ICAEW archive.

Archive and Knowledge Base

This archive of Excel Community content from the ION platform will allow you to read the content of the articles but the functionality on the pages is limited. The ION search box, tags and navigation buttons on the archived pages will not work. Pages will load more slowly than a live website. You may be able to follow links to other articles but if this does not work, please return to the archive search. You can also search our Knowledge Base for access to all articles, new and archived, organised by topic.

Open AddCPD icon

Add Verified CPD Activity

Introducing AddCPD, a new way to record your CPD activities!

Log in to start using the AddCPD tool. Available only to ICAEW members.

Add this page to your CPD activity

Step 1 of 3
Download recorded
Download not recorded

Please download the related document if you wish to add this activity to your record

What time are you claiming for this activity?
Mandatory fields

Add this page to your CPD activity

Step 2 of 3
Mandatory field

Add activity to my record

Step 3 of 3
Mandatory field

Activity added

An error has occurred
Please try again

If the problem persists please contact our helpline on +44 (0)1908 248 250