VBA Code To Dynamically Change Pivot Table Show Calculations As Normal or Running Total In

GHerms

New Member
Joined
Jun 30, 2018
Messages
1
First time poster, long time beneficiary of this forum :)

I am fairly new to VBA coding, but consider myself a pretty advanced Excel user.

On to the area I need some help with. I have created a sales dashboard with various charts and metrics that is controlled via slicer panels. There are two slicer panels, "Month" and "Period View" that allow the user to see the dashboard in different ways. The "Period View" slicer allows selection of either a rolling Year To Date view (a cumulative rolling sum of current plus prior months) or Month discrete (no running total). These work fine on the dashboard, however, I also have another worksheet that contains a pivot table controlled by these slicers. The issue is that if the user selects Year To Date on the slicer, the pivot table sums the rolling total of each month, thus giving a compounded total.

The solution I am looking for is some code to automatically change the way the pivot table calculates the "Show Values As" setting based on whether the user chooses YTD or Month Discrete. If the user chooses "Month Discrete" then the calculation setting is "Normal." If the user chooses "Year To Date" the calculation auto changes to "Running Total In..."

Is this possible? I sincerely appreciate your help, I have spent a great deal of time researching and experimenting with no luck yet.

EDIT
Also posted here https://www.excelforum.com/excel-pr...lculations-as-normal-or-running-total-in.html
 
Last edited by a moderator:

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,215,186
Messages
6,123,537
Members
449,106
Latest member
techog

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top