Excel Bug Causing Corrupt Pivot Table when datasource is added to data model

Copper Contributor

I believe I've come across a bug in Excel and I'm not sure where to go with it.  I'm hoping to find a workaround, but I'd at least like to see if anybody can actually confirm that this is a bug.  This has been a difficult one to explain, but I'm hoping that my attached sample files may provide a simple reproduction of the bug.

 

My Office365 admins referred me here to see if I can get any help.

 

Background: My company uses hundreds of pivot tables that query data from our SQL Server.  In order to add Measures/DAX Functions and PowerPivot add-in, I have been choosing to "add this data to the data model" to take advantage and add functionality to my pivot table reports.

 

Bug: I've recently noticed that if a pivot table (with a data source included in the data model) is filtered and a refresh of the data no longer contains the rows with data that was originally selected in the filter, the pivot table stops responding entirely.  It no longer refreshes, allows me to move columns around, drilldown, etc.

 

Current workaround: This forces me to either clear all filters, expand/collapse all rows prior to refreshing, or not use the data model entirely and lose out on the ability to add DAX measures.  If a user forgets to clear filters, the file can be restored from a previous version.

 

Why workaround isn't feasible:  These pivot table reports are used by a variety of users throughout the company on a daily basis.  Ensuring that every one of these users make sure to clear filters, expand/collapse all on every pivot table before refreshing is likely impossible.  Inevitably, a user will fail to do this and the pivot table report/data model link will end up corrupt and a previous version of the file will need to be restored.

 

Description of attached files:

I've created two examples of pivot tables in separate xlsm files.  One has its pivot table datasource included in the data model.  The other does not.  The datasource of both pivot tables is a simple csv file called DataSource.csv.  There are two csv files included.  One contains data for "Germany" and one contains data for "USA".  Simply toggling the file name of a CSV to datasource.csv and renaming the other to a backup filename can allow a simple reproduction of the bug.

 

Steps to reproduce:  

1.  Download attached sample files.

2.  Open Excel_NOBUG_NODATAMODEL.xlsm (this file does NOT include its datasource in the data model)

3.  Note a bit of the filtering, drilled-down fields, etc.

4.  Refresh pivot table.

5.  Pivot table will now switch from "Germany" data to "USA" data.  This works!

6.  Open Excel_BUG_DATAMODEL.xlsm (this file uses the same datasource which has been added to the data model).

7.  Note that the filtering, drilled-down fields are the same as the previous file.

8.  Refresh pivot table.

9.  Pivot table will now "break".  You can no longer change your filters, expand/drilldown etc.

10. Rename DataSource.csv to usa_DataSource.csv

11. Rename germ_DataSource.csv to DataSource.csv

12.  Excel_BUG_DATAMODEL.xlsm will now refresh properly.

13.  Clear all filters, expand all fields in the pivot table.

14. Rename DataSource.csv to germ_DataSource.csv

15. Rename usa_DataSource.csv to DataSource.csv

16. Since filters and drilled down fields were cleared up, pivot table will now refresh successfully.

 

Can anybody else reproduce this?

8 Replies

@mmichaels 

I can't reproduce these steps:

===

6.  Open Excel_BUG_DATAMODEL.xlsm (this file uses the same datasource which has been added to the data model).

7.  Note that the filtering, drilled-down fields are the same as the previous file.

8.  Refresh pivot table.

9.  Pivot table will now "break".  You can no longer change your filters, expand/drilldown

===

Open the file, PivotTable has data for Germany and data model for USA. Open any filter, in drop-down I see unselected items for USA (as it shall be, they are taken from data model). Select any few items, PivotTable takes data from data model (for USA) and shows selected items.

 

On which version of Excel you are?

@Sergei Baklan I am running Version 2110 (Build 14527.20276)

 

Thank you for your response!  I do feel like perhaps this bug is relatively new as I've been working with pivot tables, data models, measures for a long time and never seemed to notice it before.

 

With all files downloaded exactly as they are, if I open Excel_BUG_DATAMODEL.xlsm on my computer (or any in my organization), it will not refresh and change the data over to USA data.

mmichaels_0-1637246132867.png

 

I have added an MP4 video demonstration of the bug.

@mmichaels 

Your version is good enough. I'll try bit later to play with configurations if will be able to reproduce the bug.

I was able to confirm that this is a bug based on a recent update. I reverted my version of Office to 16.0.14326.20238 (2108 14326.20238) which was released on 8/25/2021 and the bug is gone. My pivot tables are refreshing normally.

I am going to continue to step up my updates of Office manually build by build to determine what update caused the bug.

 

I reverted my version by following the instructions here:
https://support.microsoft.com/en-us/topic/how-to-revert-to-an-earlier-version-of-office-2bd5c457-a91...

@Sergei Baklan I can confirm that this bug first appeared in Version 2109 (Build 14430.20234) released on 9/28/2021.  I have attached a video of the pivot table being refreshed in Version 2108 (Build 14326.20404) that WORKS PROPERLY.  Then a video of the pivot table being refreshed in Version 2109 (Build 14430.20234) that DOES NOT WORK PROPERLY and results in a corrupted pivot table.

 

Thank you so much for asking me what version I was running.  I have been trying to figure out what I've done wrong or a workaround for weeks.  You question about the version at least led me to question whether this was caused by a build update.

 

I'm not sure where to go from here with this bug.  But at least I know what I'm dealing with.

This bug appears to have been resolved in update 14527.20312 and 14701.20226 released early December 2021.
I was having similar issue while using any Data Model based Pivot Table and, in my case, the Excell was crashing after some time when i tried to save the file. I reverted my version of Office to 16.0.15128.20224 which was released on May 10 and the bug is gone. My pivot tables are refreshing and Excell is not crashing while saving. Thanks to your post for the idea.