+ Reply to Thread
Results 1 to 5 of 5

Excel pivot table tied to POWERPIVOT won't refresh without opening POWERPIVOT?

  1. #1
    Registered User
    Join Date
    06-13-2012
    Location
    Connecticut
    MS-Off Ver
    Excel 2010
    Posts
    35

    Excel pivot table tied to POWERPIVOT won't refresh without opening POWERPIVOT?

    I have prices on an Excel sheet and these prices are used in a calculated column in POWERPIVOT. I then have a pivot table in Excel that sources its data from this POWERPIVOT table. So it's a triangulated setup.

    I was hoping I could change the price in Excel and see that price change reflected in the Excel pivot table. But the data does not change even if I refresh the pivot table. The only way I can get the new price to flow through to the pivot table is if I actually open up POWERPIVOT (or already have it open) and also make it the active app by clicking on it. Then it refreshes. Is there some way to make this refresh happen without opening and activating POWERPIVOT? How about making the refresh happen automatically whenever the price is changed?

    Thanks!
    Last edited by Rhino_dance; 07-22-2015 at 11:23 AM. Reason: Added info

  2. #2
    Registered User
    Join Date
    01-13-2015
    Location
    Leicester, England
    MS-Off Ver
    2013
    Posts
    42

    Re: Excel pivot table tied to POWERPIVOT won't refresh without opening POWERPIVOT?

    Have you tried the Refresh All option? I honestly only use that since refreshing seems to work sporadically. You can find it if you click on the down arrow below the Refresh button. Keyboard shortcut is Ctrl+Alt+F5.
    As far as I know, the pivot wouldn't refresh automatically. The most you could do is to go into Options ->Data and select "Refresh data when opening the file". But that wouldn't help you.
    I would also make sure that the pivot's source contains any new additions to the source table. I usually use Insert->Table to make sure any additions are included in the source as opposed to Name ranges in the Names Manager.

    Alex

  3. #3
    Registered User
    Join Date
    06-13-2012
    Location
    Connecticut
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Excel pivot table tied to POWERPIVOT won't refresh without opening POWERPIVOT?

    Thanks Alex. Yes, 'Refresh All' works! Not sure why I didn't think of that.

    I've looked into this problem more and found that I can use the vba command ActiveWorkbook.Model.Refresh (since I'm in Excel 2013) and this will refresh that pivot table that reads from POWERPIVOT. My idea now is to trigger that vba code any time the user changes a prices in column B- but for some reason I can't get the trigger to work.

    The boilerplate vba code for monitoring a change in cells B1:B100 is this:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("B1:B100")) Is Nothing Then
    Refresh_Power_Pivot
    End If
    End Sub

    And that triggers the refresh code which is this:

    Sub Refresh_Power_Pivot()
    ActiveWorkbook.Model.Refresh
    End Sub

    However when I change a price in one of the B cells the pivot is not refreshing.

    Any ideas on why it wouldn't refresh? Again, I appreciate your thoughtful response. -John
    Last edited by Rhino_dance; 07-23-2015 at 10:27 AM. Reason: typo

  4. #4
    Registered User
    Join Date
    01-13-2015
    Location
    Leicester, England
    MS-Off Ver
    2013
    Posts
    42

    Re: Excel pivot table tied to POWERPIVOT won't refresh without opening POWERPIVOT?

    I'm more of a novice in VBA so I can't help you there. Even so, I wouldn't want my pivot to refresh with any change because it might slow everything down. Usually, a power pivot takes a bit longer to refresh and if you have a lot of data, a refresh with every change might just make you want to bash your head against a wall (I work with big data sets and this would not be an option for me, except for the head bashing which I am not particularly fond of). If you're working with small amounts of data it might be useful. However, I also believe you can't undo after a macro runs but a manual refresh can be undone (just in case you want to undo, maybe to compare numbers before and after the change, or if the change was by mistake). That's my 2 cents.

    Alex

  5. #5
    Registered User
    Join Date
    06-13-2012
    Location
    Connecticut
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Excel pivot table tied to POWERPIVOT won't refresh without opening POWERPIVOT?

    Thanks Alex. The update only takes a few secs but that is with just 1,200 test records. However, as I increase my data size that might not be the case.

    Also, I solved the problem I was having. The code to detect the change on the sheet must be in a module dedicated to the specific sheet that contains the range B1:B100. So I had to right click on the specific sheet tab and select 'View Code' and then paste my code into that Module. Cheers, John

+ 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. Replies: 4
    Last Post: 08-08-2014, 10:35 AM
  2. Replies: 2
    Last Post: 06-02-2014, 09:34 AM
  3. Powerpivot Calculated Measure to remove blanks from pivot table/chart
    By hbusche in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 07-17-2013, 01:23 PM
  4. Replies: 0
    Last Post: 11-20-2012, 05:34 AM
  5. Replies: 1
    Last Post: 11-29-2011, 10:52 PM
  6. Pivot table missing rows using PowerPivot
    By djgfx in forum Excel General
    Replies: 1
    Last Post: 04-06-2011, 01:16 PM
  7. Getting PowerPivot to Refresh
    By jantonio in forum Excel General
    Replies: 5
    Last Post: 12-07-2010, 02:55 PM

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