Hiding useless sub rows in pivot hierarchy without changing the calculation

Copper Contributor

Hello, I have the following issue with excel pivot:

 

When I have a table with projects, sub projects and sub sub projects:

 

image.png

 

and create a pivot table, it looks like this:

 

image.png

 

When i try to hide the "(empty)" rows, pivot removes the whole row, so all that's left is the row that doesn't have any "(empty)" values in "Main Project", "Sub Project" or "Sub Sub Project":

 

image.png

 

image.png

 

But what I actually want is the following:

 

image.png

 

I don't want to filter data, I just want to hide hierarchy levels, when they are not needed.

 

I am using SQL Server data and VBA with the copyfromrecordset method. I would prefer a simple solution without VBA or SQL Server but if there is a way with VBA or SQL Server to fix this hierarchy problem in pivot tables, it would be perfectly fine too.

 

Thank you very much for your help and best regards.

0 Replies