Excel pivot table: How to hide Base Item when showing values as “Difference from…”?

一曲冷凌霜 提交于 2019-12-14 02:48:03

问题


I'd like to create a pivot table with values presented as a difference from a specified Base Item. However, I'd like to hide Base Item itself, as it adds redundant empty space to a table.

Picture showing what I'm looking for:

Is it doable? I'm looking for a solution that does not require hiding worksheet rows or using VBA macro.

Also, I'd like to refrain from adding aditional columns to source table.

Note: filtering out Base Item results in #N/A error as seen below:


回答1:


You can't hide the base item when using it in a "Show values as..." setting.

You can, however, create a calculated items that calculate the difference from A, display those items and hide all original items.

In your PivotTable, click any item in the Row labels.

From the PivotTable Tools ribbon, go to Options > Fields, Items, & Sets > Calculated Item

You'll need to give it a unique name, such as using underscores or remove spaces.

Then create the formula for the field. Select your Dimension field in the Fields list. Select the B Item in the Items list and click Insert Item to add it to your Formula. Enter the a minus then Insert the A Item. Click Save and the new calculated field is added to your PivotTable. Repeat for Item C. Now you can hide the original Items and display only the calculated difference for Items B and C from Item A.



来源:https://stackoverflow.com/questions/35608367/excel-pivot-table-how-to-hide-base-item-when-showing-values-as-difference-from

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!