Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

hide column in pivot table with condition

Hello,

I'm trying to hide specific columns in pivot table with conditions but failing.

Please tell me if you know  how i can achieve it.

The chart I want to make is like the one below.

It has A and B and each of them have different columns.

I thought I can use the option  in expression tab

but it doesn't work well and every columns(ColumnA to ColumnF) are showed in both A and B.

column.png

4 Replies
Siva_Sankar
Master II
Master II

Hi,

You do hide / unhide the columns in a pivot table by enabling / disabling the "conditional" checkbox in the "Expressiones" tab of the pivot table, and writing a condition in the box below the checkbox.

Also,

using macro you can use conditional formatting expression or you can write a macro to make coloumn width Zero

Macro would be on expression:

     set chart = ActiveDocument.GetSheetObject("CH01") 'Your object ID

     set p = chart.GetProperties

     set expr = p.Expressions.Item(0).Item(0).Data.ExpressionVisual

     expr.ColWidth = 0

     chart.SetProperties p

Regards.

Siva

sureshbaabu
Creator III
Creator III

Hello,

Are you trying to use two dimensions in your chart. could you please be clear on what you are trying to hide?

it can be achieved thro the expression tab

thanks

Anonymous
Not applicable
Author

Please be more specific regarding your requirement,

and please post some sample for better understanding..

Not applicable
Author

Thank you all for your help,

After I posted I found  Pivot table - Hide/show columns

and this is almost the same as  what I wanted to do.

Thank you anyway.