+ Reply to Thread
Results 1 to 6 of 6

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

Hybrid View

  1. #1
    Registered User
    Join Date
    02-02-2015
    Location
    Pittsfield, MA
    MS-Off Ver
    Office 2013
    Posts
    2

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

    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.

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: VBA Code To Dynamically Change Pivot Table Show Calculations As Normal or Running Tota

    Cross posted https://www.mrexcel.com/forum/excel-...ing-total.html
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,704

    Re: VBA Code To Dynamically Change Pivot Table Show Calculations As Normal or Running Tota

    Rule 08: Cross-posting Without Telling Us

    Your post does not comply with Rule 8 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question. If you have fewer than 10 posts here, you will not be able to post a link, but you must still tell us where else you have asked the question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    If you have less than 10 posts, do not try to copy and paste the link. Instead, type the link out in your thread.
    Last edited by alansidman; 07-02-2018 at 06:48 PM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    02-02-2015
    Location
    Pittsfield, MA
    MS-Off Ver
    Office 2013
    Posts
    2

    Re: VBA Code To Dynamically Change Pivot Table Show Calculations As Normal or Running Tota

    As this was my first post, I am not allowed to include a link in my post. How should I proceed?

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,704

    Re: VBA Code To Dynamically Change Pivot Table Show Calculations As Normal or Running Tota

    @Herms27
    You are correct. Since Kev has posted for you, I will amend the post to allow others to respond.

  6. #6
    Registered User
    Join Date
    09-13-2012
    Location
    Queensland
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: VBA Code To Dynamically Change Pivot Table Show Calculations As Normal or Running Tota

    Can you attach a file as example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Pivot table and running total
    By jcrow in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 06-19-2015, 02:36 AM
  2. Replies: 1
    Last Post: 06-25-2010, 11:27 AM
  3. Pivot table running total
    By Avner in forum Excel General
    Replies: 4
    Last Post: 11-23-2006, 12:08 PM
  4. Pivot table and running total
    By PaulGG in forum Excel General
    Replies: 2
    Last Post: 11-29-2005, 04:20 PM
  5. Pivot table and running total
    By PaulGG in forum Excel General
    Replies: 0
    Last Post: 11-28-2005, 05:45 PM
  6. [SOLVED] % of running total in pivot table
    By eggman in forum Excel General
    Replies: 0
    Last Post: 10-13-2005, 12:05 PM
  7. [SOLVED] % of Running Total to Grand Total in Pivot Table
    By David in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-17-2005, 04:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1