Excel Pivot Tables - Is This Possible?
Excel Pivot Tables - Is This Possible?
Author
Discussion

paulrockliffe

Original Poster:

16,687 posts

258 months

Tuesday 19th June 2018
quotequote all
I've got a Pivot Table that is basically a comparison of 5 years of data for a series of metrics. I need to create several more Pivot Tables that are essentially identical, except that they will contain different metrics. The data for all the metrics is structured in exactly the same way, the source is a single table that is sitting within the Excel Data Model.

I can easily copy the worksheet, change the formatting and titles and swap the other metrics in, I've already done this. However, I would prefer to keep the workbook clean and use a drop-down or a slicer etc to select which group of metrics to display, so that I only need one worksheet for the whole data pack. This is partly to make it user friendly, but also because there is a load of metrics that aren't currently in the workbook because no one wants to scroll through 15 worksheets, changing the approach means I can put more data in and also I can easily build metric packs on demand to meet niche requests.

I've not tried to do this yet, I'm working through various other templates before I try this as I'm working to a deadline and this feature can be dropped this quarter if time runs out. Has anyone done similar and is it possible without dropping into VBA?

We've only just got Office 2013 with the Power Pivot stuff built-in so I've not messed about with some of the stuff in there. I wondered if I could add all my metrics as columns to a very wide Pivot Table and then use the "Fields, Items and Sets" feature to create subsets of Columns to display? If so, how can I easily control the sets.

The other approach would be to rebuild my source data so that if (for example) I have 5 metrics on each Pivot Table, I have 5 columns in my source data, with the results for all the metrics that would ever be in column 1, 2, 3, 4, 5 in them and a helper column that labels each row with the label for the Pivot that it goes in. The helper column then becomes a filter for the Pivot.

I'm not sure the first method works, I think the second method works, but is really clunky and as soon as someone asks for a 6th column I'm having to go back into the SQL to code up another column.

Maybe there's another way?

Cheers

mmm-five

12,407 posts

315 months

Tuesday 19th June 2018
quotequote all
You can link slicers, so that a change on one worksheet is replicated on al the others.

We use it on a front sheet of a report (with 36 hidden pivots) which then produces a page showing all the dashboards relevant to the selections made (country/site/region/team/category/etc.)

paulrockliffe

Original Poster:

16,687 posts

258 months

Wednesday 20th June 2018
quotequote all
Yeah, I've done that and that works fairly well, except that if you have the slicers on each page for ease of use it recalcualates every Pivot when you change any slicer, so as soon as you introduce a big Pivot it slows all the slicers down, but that's fairly minor.

My question is really around whether I can use the Slicer to control different Sets within a single Pivot. I did some googling and the answer appears to be that you can, but only with a very convoluted method involving linked tables and MDX statements that reference various things. The VBA to change the set is relatively easy, so I'm going to go that route I think.

I knocked up a test spreadsheet and got it to work, my only reservation is whether it'll work well with large datasets as it seems to be designed more for static management of Pivot Table views, rather than a dynamic method for quickly swapping data in and out.