You are on page 1of 1

Contact Us | 877.392.3539 | info@excelandaccess.

com HOME ABOUT FAQ TEAM CLIENTS TESTIMONIALS PARTNERS BLOG CONTACT
! EXCEL EXPERTS  ACCESS EXPERTS POWER BI EXPERTS # WHO WE SERVE $ LOCATIONS % RESOURCES /

MS EXCEL PIVOTTABLE DELETED ITEMS REMAIN Home > Blog > MS Excel PivotTable Deleted Items Remain

* Previous Next + Popular Recent ,

Working with Microsoft Excel


tables in VBA
MS Excel PivotTable Deleted Items Remain January 7th, 2013

PivotTable’s are a wonderful thing, but they have their downsides. One of them is the fact that they will retain
MS Excel PivotTable Deleted
deleted data from the data source, which shows up in filter drop downs and slicers. This can be slightly (up to
Items Remain
extremely) annoying and hard to find where to not show pesky deleted items. March 14th, 2013

There are two areas where this is most affected – filters and slicers. You can take care of this in one fell swoop
with a PivotTable setting change, or you can fix this for slicers only. Both are detailed below. I’ve utilized a
Create Before/After Query
Microsoft template using Excel 2013 for this example and screenshots.
Update Events
January 18th, 2014

Starting data
The template I started with has a PivotTable already, which just made it easy to use for this example. Here is OUR CORE PRINCIPLES
what it looks like:
- We Deliver On Projects

- Our Company Mission

- Our Philosophy

- Our Promise

OUR CONTACT INFO

Corporate Headquarters
17880 Sky Park Circle
Irvine, CA 92614

Phone: 949.612.3366
Email: info@excelandaccess.com
Web: excelandaccess.com

There’s some dashboard data up top, then an overall chart, and below that is our PivotTable with slicers to its
right. Before we get to the fixes, we need to show the problem, and before we do that, well, we need to create it.

Add a record
To create this particular problem, I’ll just add a new row of data to the data source. Before we get there, you
should get an idea of what values are currently in the PivotTable. Here is the filter drop-down for the AREA field:

Notice there are only three unique items listed. We’ll revisit this in a moment. First, let’s create this behavior
we’re talking about.

For this particular template used, data input is on the COST INPUT worksheet.

TIP

If the totals row is showing for a table, and you can’t just start typing a new row, select the bottom-
right-most cell in the table data body range and press Tab.

Now we add a row of data:

So I added a cabinet to the upstairs bathroom. Ooh, and it only cost me $250. Yay! Ok, data added.

If you now look at the pivot table, you won’t automatically see your data.

TIP

To refresh the PivotTable, either right-click any cell in it and select Refresh (as seen in the picture
below), or go to the PIVOTTABLE TOOLS

ANALYZE ribbon and select Refresh there.

Once you refresh the PivotTable you should now see the newly added data. We will check the filter drop-down,
which should show us a list of unique values from that field.

As you can see, there is now an “Upstairs” item listed for that field.

Delete the record


Down to the nitty gritty. We are going to delete this newly added record of data. So go to the data source table,
make sure the new row (or any cell in it) is selected and either right-click -> Delete -> Table Rows, or from the
HOME tab, select Delete (in the Cells group) -> Delete Table Rows:

If you now refresh your PivotTable and look at your filter drop-down menu, you should notice you will still see
data for the deleted row from the source menu! In addition, you will see it on any related slicers as well.

Now for the fixes.

Slicer fix
This is a very simple, yet hidden and somewhat cryptic fix. Quite simply if you select your slicer (any slicer you
want this to work on, which, alas, must be done individually) you can get to the slicer settings by either the
right-click menu, or the ribbon (SLICER TOOLS

OPTIONS -> Slicer Settings):

This will bring up the slicer settings dialog box. What you’re looking for is in the bottom-right corner, a little
check box that says “Show items deleted from the data source”. Uncheck that, click OK and your slicer is now no
longer showing phantom data.

PivotTable fix
Fixing the slicers are nice, but that doesn’t clear these deleted items from the PivotTable filter drop-downs. To
do this we need to go into the PivotTable Options and look at the Data tab. Here you will see an item that says
“Retain items deleted from the data source” with a combobox for you to set the number of items to retain per
field:

By default it’s in automatic. Just change this to None and click OK. Voila! That’s it, you’re done. No more phantom
deleted items showing up in your PivotTable. The best part of this fix is it takes care of the slicers too. Think of it
as a cascade of deleted data. Fix the PivotTable and it will fix the slicers – all of them (using that data source).

Summary
While PivotTable’s are a tremendously powerful tool, sometimes the default settings aren’t so helpful. This is
one of those ‘PivotTable’s 101’ things, but is hard to find if you don’t know where it’s at.

Related

Table Slicers in Microsoft Excel 2013 Microsoft Excel 2013 Templates Get Table Addresses
March 7, 2013 January 19, 2013 January 14, 2013
In "Blog" In "Blog" In "Blog"

March 14th, 2013 | Tags: Data, Template, Simple, Microsoft, Slicers | 19 Comments

Share This Story, Choose Your Platform! ! " # $ % & ' ( )

19 Comments

Kayte October 2, 2013 at 9:40 am - Reply

Thanks, you are a star.

Abigail Rumsey October 8, 2013 at 10:57 am - Reply

What a stupid default setting! Thanks for the tip!

André March 4, 2014 at 9:33 am - Reply

Thank you- I was just looking for how to get this fixed.

Robert Mardock (@mardorm) April 29, 2014 at 9:37 pm - Reply

Thanks! This solved my random and frustrating data problem. Now if you could only solve (or direct
me to) how to get rid of the useless “(blank)” drop-down label.

derek July 21, 2014 at 5:41 am - Reply

Does anyone have the same problem as I faced? The number of items to retain per field is not
configurable. It does not allow me to switch from automatic to any other setting.

excelandaccess July 21, 2014 at 6:10 pm - Reply

Derek, if the source is an OLAP data source that option isn’t available. I’m not aware of any other
reason that would be disabled.

derek July 21, 2014 at 6:50 pm - Reply

I’m sorry, I don’t know what OLAP means. But I created my data using a table and then
created the pivot table within the same workbook.

excelandaccess July 21, 2014 at 8:04 pm - Reply

OLAP stands for Online Analytical Processing, and is how PivotTables are created from places like SQL
Server. I don’t know of another reason why it would be disabled. What version of Excel are you using?
How did you create your table? How did you create your PivotTable? Are any of the worksheets
protected?

derek July 22, 2014 at 5:00 am - Reply

I’m using Excel 2013. I created the table using the ‘format as table’ button and created my PivotTable
using the insert PivotTable button. There are no protected worksheets. Yes I find it weird too. When I
did the same on a new workbook, it could allow me to make selections under the number of items to
retain per field option. I do appreciate your help in this. If there is no answer to this mystery, then I
would just from scratch.

excelandaccess July 22, 2014 at 6:09 pm - Reply

I wonder if you created another PivotTable from this same table if you would have the same
results? I’d love to test it if possible, as unfortunately I can’t replicate it, nor do I know of any
other conditions which would make that happen. Sorry.

derek July 23, 2014 at 3:17 pm - Reply

I created another Pivot Table from this same table and now I can select from the options. It appears to
be a problem with that particular Pivot Table only. Thanks so much anyway!

Applesh December 4, 2014 at 3:38 pm - Reply

My pivot is OLAP data sourced, so is there any option for me to delete those old data in the filter?

Sue May 7, 2015 at 11:53 pm - Reply

Thank you, this is exactly what I was looking for!


As I’m renewing my skills in pivots and slicers (never heard of slicers before but really great and easy
to use!) and then you run into this kind of practical problems. As I’m developing a tool that needs to
be adjusted for different businesses. After the first file saved it under different name and emptied
everything and started for the next business and had all the other ‘old stuff’ still in the slicers ….. But
better to adjust the pivot I understand now.
I saved your address and again, many thanks!

Nigel Dyer July 15, 2015 at 7:45 pm - Reply

I have also found that (in Excel 2010 at least) the presence of retained items can mean that if a
column is set to be sorted then the items are not always sorted properly after the table is refreshed.
Setting the number of items to be retained to ‘none’ fixes the problem.

Syeda Warisha Azam September 22, 2015 at 11:42 am - Reply

Thank you soo much this was really really helpful

Sandra November 30, 2015 at 8:43 am - Reply

Hi, I want to share my layout without sharing my data. I deleted all data and followed the steps
suggested. Now everything appears empty, but it is not!! After saving the file underca different name,
closibg excel and reopening again, I tried to reverse the process and then the data comes back (at
least in the slicers). This means it isn’t gone, it is just not shown, but it is still there. How do I
permanently delete this?

excelandaccess December 9, 2015 at 2:33 am - Reply

Hello Sandra.

You can get an answer to your question at our forum, Vbaexpress.Com


http://www.vbaexpress.com/forum/forumdisplay.php?17-Excel-Help

Christopher

A Reader July 2, 2020 at 2:28 pm - Reply

PivotTable’s are a wonderful thing. Table’s? Really? … Q-R-apostrophe S, T-U-V … isn’t the way the
alphabet song goes.

Joe Cross August 4, 2020 at 6:17 pm - Reply

Years later and this is still helpful!


It was the top link when I googled my issue. Thanks so much!!

Leave a Reply

COMPANY PROFILE TAG CLOUD OUR CONTACT INFO PROFESSIONAL DESIGNATIONS

Learn Value Database


Power BI Corporate Headquarters
17880 Sky Park Circle
Microsoft Professional Irvine, CA 92614
Since 1994, Excel and Access, and its Phone: 949.612.3366
Functions Business
portfolio of companies, has been the Email: info@excelandaccess.com
market leader providing benchmark Consulting Training Slicers Web: excelandaccess.com
Microsoft Application solutions. Microsoft MVP Data model Finance
We have local Excel and Access Event Pivot Table Excel Tables
developer offices across the globe, OUR CORE PRINCIPLES
we are where you are, we have your
Video Query Workbook
needs and locations covered. Productivity Code Experts
- We Deliver On Projects
Our team of dedicated professionals Microsoft Excel
are among the leading experts in Programming Client Excel - Our Company Mission
consulting, programming and
training for Excel and Access. Worksheet Template Microsoft - Our Philosophy

Microsoft is one of our clients. Office Simple HTML Form Excel


- Our Promise
And Access Data Custom
Access Macro Formulas Variable
Tables Government Contact
Calculation Free

Google Rating
4.9
Copyright © 2020 - Current | All Rights Reserved | Powered by Excel and Access, LLC # ! " .
0

You might also like