Forum Discussion
Andrew M
Feb 14, 2024Brass Contributor
Duplicate distinct counts in pivot tables corrupts files
Hello! I may have discovered a bug. I have a problem with pivot tables corrupting if I place a column of data into the values section of a pivot table twice and summarize both values as a distinct count. Has anyone else run into this? Do you know what root cause of this error is? How can I eliminate this error?
Some more detail:
I have had problems over the past week with normally stable Excel files becoming corrupt. If I click "Yes" when asked if I want to recover the file, I always receive a message that listing pivot tables that were removed.
Today, I noticed I can replicate this problem by placing a field into the "values" section of a pivot table twice and summarizing both of these value fields as a distinct count. I tested several permutations (two different fields but counted distinct, the same field placed as a value twice but only summarized as distinct count once, etc), but only the scenario listed produces an error.
I reproduced this error on three computers. Two coworkers had the same problem this week and were able to replicate the error following my steps. A friend at a different company replicated it as well.
My work around is to create a duplicate dummy column, place that alongside the first column into the pivot table (example, ItemID and ItemID_helper), then summarize both as distinct counts. However, I want to understand and solve the root cause of the problem to prevent errors in other existing spreadsheets containing pivot tables built this way.
If you’re wondering why I have duplicate distinct columns, column one displays the count as is, column two displays as a percent to total. Example, warehouse one has 34 unique customers which is 67% of total unique customers.
- Thank you so much, Andrew!:)
- Tim_OpieCopper Contributor
Hi, am also getting this issue with some sheets with pivots. Any response from Microsoft support from your ticket?
SPO, opening file with Excel for Web and desktop app both give the corrupted file error. Opened in Google sheets, exported it back to xlsx file and it is working fine.
- Andrew MBrass ContributorNo reply yet, but the ticket is still open.
- Freddie_DCopper ContributorAlso able to reproduce on Excel for Microsoft 365 MSO (Version 2401 Build 16.0.17231.20236) 64-bit, albeit having stumbled upon this via my own data and being lazy with implicit measures!
- NamonpasCopper ContributorHi,
Seems like I also encountered the same error when I'm trying to Count Distinct on pivot table
Error message is:
We found a problem with some content in <filename>.xlsx. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes.
Do we know if this error will got fixed/looked into by the team?
Thank you so much!:) - LorenzoSilver Contributor
Hi Andrew M
It seems I can't repro. with Excel for Microsoft 365 MSO (Version 2401 Build 16.0.17231.20194) 64-bit
It could be I misunderstood something, didn't use the same Measures... Could you:
- Upload/share a sample where you get the problem
- Mention what exact version of Excel you run
- Andrew MBrass Contributor
Lorenzo , thanks for replying! I'm on Microsoft 365 for Enterprise , Version 2401 Build 17231.20194 64-bit. Almost the same as you, but my version doesn't say 16.0.
Did you save the file, close it, and reopeon? I only get the error upon reopening a file containing a pivot table with those parameters. The act of creating the table and making selections doesn't cause any problems.