macro to change multiple slicer values - excel

I am at a loss after some searching.
I have two pivot tables driven from two different data source/caches. source 1 is a table with departments' total charged amounts, source 2 has the same departments with the total denied dollar amounts. I am pulling the data from both of these into pivot tables so that I can manipulate the department (among other things) to calculate percentages.
My original thought was to set a "Department" slicer for each table, and have a macro assigned to one of the slicers to change the second one so that both pivot tables filter the department. I was also thinking of possibly using one slicer, and assigning it a macro to simply filter the department on the second pivot.
both of these tables will be hidden with the exception of one of the slicers and will have the calculated data from each table pulled to the top of the sheet for easy viewing.
both sheets/data sources are derived from separate reports with completely different data & headers.
thanks in advance for any help.

I finally came across something useful on contextures
It works exactly how I want it to, I simply linked the slicer connected to 4 other pivot tables with a separate cache than my "main" slicer/table and hid the linked slicer. When I select and option from the main slicer, it updates the hidden slicer thus filtering all the other pivot tables.

Related

Compare 2 pivot tables side by side

I have a pivot table gathering data from a sheet, using slicers i'm able to filter data.
What i wanted to do is get data from 2 slicers, like one slicer with March and another with June and show it side by side within the same pivot table or different, So I can compare data.
I'm using Excel, any ideas?
Let me know if there is anything else u might need to help
Before creating any slicers, copy your pivot table and place beside the original table. Then create your Slicer on Pivot 1, and repeat for Pivot 2. These will be exclusive slicers as long as you do it in this order.

Pivot Table Value Adjustments

I have a pivot table from multiple tables. When I double-click my pivot table data, it produces a copy of the row(s) that data came from. Is there a way for me to make adjustments aka change the values of cells in these rows, and have it only adjust the pivot table?
What I'm mainly looking for is an easy way of viewing the data through the pivot table, and adjusting it without it necessarily affecting the source tables. Right now when I adjust a row produced by the pivot table, none of the values in the actual pivot table get updated.
What about producing a new PivotTable from the drilldown sheet that got produced when you double-clicked the old PivotTable?
That's about as close as you're going to get, I'm afraid.
The pivot table is a visualization tool only. It summarizes that data that you input into the pivot table, and gives you a visual output.
If you want to change that visual output, you have to copy the relevant part of the pivot table to another area (different cell or sheet, doesn't matter). Then, you can edit that table.

Copy Filters from one PowerPivot PivotTable to another

I have 2 PivotTables that were created from PowerPivot connections. I would like the second PivotTable to change based on a selection the user makes on the first PivotTable. I have some VBA background, so you don't need to write the whole code but point me to the right functions/structure.
If you use slicers, you can simply link both tables to the same set of slicers. You can even have multiple copies of each slicer.
It's the same in all versions of Excel since 2010. Here's a link.
Edit: Adding information from my comment below here.
You can use this technique even when you're explicitly using a filter on the pivot table, whether by adding a field to the Filters section, or by putting that field on the row/column labels and then limiting the selection based on that row/column header drop down. You can mix and match these as well, with Pivot1 having the field in question in the Filters section, and Pivot2 having the field in the Rows section.
Just create your two pivot tables as normal, and then connect both to the same slicer. This slicer can be hidden on another sheet that is not displayed to the end users. This solution is much more expedient than the VBA solutions I've seen.

Master PivotTable Filter

I have 6 pivot-charts on many worksheets (each worksheet corresponding to different individuals), all pivot-tables have a Month filter. Instead of clicking on each individual filter to update the pivot-table (and corresponding pivot-chart). Is there a way of creating a 'master' filter button so that all filters are updated?
Let me know if you require further information.
You can accomplish this by using a slicer. Slicers are similar to filters, but look a little different and can be associated with multiple pivot tables. This means you might want to make a "front page" or similar area with the slicer on it so it is obvious that the one slicer controls the month filter for all pivot tables.
You just insert the slicer on the page, then click on Report Connections and connect it to each pivot table.

Is it possible to filter data used by pivot table based on filtering the rows in a source table in Excel?

I have developed a dashboard in Excel 2007 that uses one source table in a sheet (being filled with a query on our data warehouse) and multiple pivot tables making different cross sections on this data.
I use the GETPIVOTDATA in almost a hundred formulas to give me the right value for a specific indicator in my dashboard.
This all works fine. However I now have received the question to make the dashboard for 5 different segments. As you can imagine I don't want to create 5 different workbooks for this and need to maintain the dashboard logic on all of them.
So my question is the following. Is it possible to automatically (through VBA or any other means) filter the results in my source table which is the source for my pivot tables and thus for my dashboard values.
So schematically:
DATABASE_VIEW --> SOURCE_TABLE --> 12 pivot tables --> 100 GETPIVOTDATA functions
Preferably I would like to load all the segments in the source_table (one view on my database) and then filter the data in the source table, which results in filterd source_dat for my pivots. This way I can (without requerying the db) quickly change between segments in the dashboards (refreshing pivots only).
Data in the source table has the column: CUSTOMER_SEGMENT available to filter upon.
Any help is appreciated.
Geoffrey
You can manipulate all external data connections and internal pivottables through VBA.
To make it a double learner for you I recommend using the Record Macro button and then changing a filter in your pivot table and also change your SQL query a bit.
You will now see that in the recorded macro the related properties of that Pivottable/query are stated. Filters and SQL are simply Strings in the VBA code, thus you can alter certain bits to get different filters or "WHERE Cust_ID = " comboboxCust.Value kind of things.
Doing it through VBA codes to change the filters and SQL is usually more speedy then having it all interactively related with the standard Excel tools (Functions, parameters, linked filters, ...)

Resources