Forum Discussion
Mariham Iskandar
Aug 25, 2017Copper Contributor
Pivot Table Will Not Update Properly
I have data created in PowerQuery that is connected to PowerPivot which generates PivotTable in my excel sheets. I have noticed that my pivot tables do not refresh with the most recent data once I: refresh the table, refresh the powerpivot, or refresh all data. Some data is refreshed but not all. The only way I can actually get correct info is by generating a new pivot table where it will get updated info. I have many pivot tables that are conditionally formated and do not want to have to go through the whole process of recreating my pivot tables one by one and reformating them everytime I refresh my excel data. How do I fix this?
I always had the exact same problem and finally found the solution, which appears to be embarrasingly simple.
Click Change Data Source. After updating my data (obviously) the data range has expanded! Select the data set again and voilà.
- Vinod JagroepCopper Contributor
I always had the exact same problem and finally found the solution, which appears to be embarrasingly simple.
Click Change Data Source. After updating my data (obviously) the data range has expanded! Select the data set again and voilà.
- KonsiloCopper ContributorThank you so much !
I also had this problem and the solution is indeed simple once you know it.
- Brian SpillerBrass ContributorDepending on the complexity of your Queries, you may have to Update All twice. Excel doesn't know what to update first. So if your Pivot Updates before the Query updates the Data Model or Table, then the Pivot Update will be ineffective the first time.
Hi Brian,
Not exactly. How queries are updated is explained, for example, here https://social.technet.microsoft.com/Forums/en-US/8d5ee632-fdff-4ba2-b150-bb3591f955fb/queries-evaluation-chain?forum=powerquery
Bit different story with PivotTables, if we disable background refresh all queries will be refreshed before PivotTables.
That affects refreshing bahaviour if PivotTable is built on data (table) returned by query. In this example:
Query1 and Query2 return two identical tables based on one source Table1. We have two PivotTables on that tables. In properties of Query2 background refres is disabled and PivotTable2 is refreshed after the first RefreshAll. To refresh PivotTable1 we have to click RefreshAll twice.
Above sample is attached.
- lindja2Copper Contributor
Hi Mariham,
Check your query properties and be sure what "Enable background refresh" in your main queries properties is unchecked. With background refresh disabled the query complete refresh before other queries are refreshed and as well before pivot tables are refreshed.
- Atul_RainaCopper Contributor
SergeiBaklan Hi Sergei, my excel has 8 queries (with no errors) and I have unchecked the background refresh. Yet my existing pivot table does not reflect new data completely. I am showing data for 5 years and the data for two latest years is not getting updated. However, if I create a new pivot using the same power query table, the data is accurate. I cannot upload the excel as it is confidential but would be more than happy if you could help find a solution here.
- Sawcy1Copper Contributor
Hello SergeiBaklan, I wanted to post some VBA code I use to disable background refresh for all of my connections in case anyone would find it useful. I run this code on a regular basis as Excel seems to change this every time I decide to touch a query ☺ When you have many queries, this sure does come in handy!
Sawcy1
- Yemisi13Copper Contributor
HSawcy1 I have same issue, Refresh All is not refreshing my the data source in my power query which is connected to my pivot table in excel.
I followed the same steps you provided which is to uncheck the box enable background refresh but it did not help.
Do you know any further steps I can take to solve this please?
- Mariham IskandarCopper Contributor
Thanks for the quick reply! I really appreciate it! Could you possibly walk through how to check my queries properties?
- Mariham IskandarCopper Contributor
Figured out how to check query properties and the "Enable background refresh" tab is unchecked already. This did not make a change.