Hide (blank) row headings/subtotals in pivot tables

%3CLINGO-SUB%20id%3D%22lingo-sub-260018%22%20slang%3D%22en-US%22%3EHide%20(blank)%20row%20headings%2Fsubtotals%20in%20pivot%20tables%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-260018%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Team%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20looking%20for%20a%20solution%20to%20blank%20heading%2Fsubtotal%20rows%20in%20a%20pivot%20table%20with%20a%20multi%20level%20hierarchy.%20A%20label%20filter%20is%20an%20easy%20enough%20solution%20providing%20the%20(blank)%20label%20value%20is%20at%20the%20lowest%20level%20of%20the%20hierarchy%2C%20however%20if%20the%20(blank)%20label%20value%20is%20in%20one%20of%20the%20higher%20%22grouping%22%20levels%20the%20label%20filter%26nbsp%3Bwill%20remove%20all%20the%20rows%26nbsp%3Bin%20the%20(blank)%20group.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20attached%20chart%20of%20accounts%26nbsp%3Bthere%20are%205%20grouping%20levels%2C%20with%201%20being%20the%20highest%20grouping%20level%20(Income%20Statement)%20and%205%20being%20the%20individual%20posting%20account%20level.%20Where%20there%20is%20no%20grouping%20required%20for%20any%20intermediate%20level%20(level%202%20to%20level%204)%20a%26nbsp%3Bsubtotal%20for%20%22(blank)%22%20is%20created%20in%20the%20pivot%20table.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20remove%20the%20heading%2Ftotal%20for%20the%20(blank)%20categories%20from%20the%20pivot%20table%2C%20or%20is%20there%20a%20way%20to%20structure%20the%20chart%20of%20accounts%20to%20achieve%20this%20outcome%2C%20or%20a%20VBA%20solution%2C%20or%20are%20there%20any%20other%20alternatives%20that%20will%20get%20the%20result%20I%20am%20after%3F%20I%20am%20open%20to%20suggestions.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20your%20time.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3EAlistair%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-260018%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-260901%22%20slang%3D%22en-US%22%3ERe%3A%20Hide%20(blank)%20row%20headings%2Fsubtotals%20in%20pivot%20tables%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-260901%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20JKP%2C%20however%20if%20a%20filter%20is%20used%20to%20exclude%20%22(blank)%22%20for%20%22ReportLevel2%22%20then%20all%20the%20child%20records%20of%20%22(blank)%22%20are%20filtered%20out%20of%20the%20report.%20All%20the%20records%20need%20to%26nbsp%3Bremain%20in%20the%20report%2C%20it%20is%20just%20the%20heading%20and%20subtotal%20that%20I%20want%20removed.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20open%20the%20file%20and%20do%20what%20you%20have%20suggested%2C%20the%20total%20of%20the%20income%20statement%26nbsp%3Bchanges.%20The%20total%20of%20the%20income%20statement%20needs%20to%20remain%20the%20same.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-260249%22%20slang%3D%22en-US%22%3ERe%3A%20Hide%20(blank)%20row%20headings%2Fsubtotals%20in%20pivot%20tables%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-260249%22%20slang%3D%22en-US%22%3EClick%20on%20the%20filter%20dropdown%20in%20A1.%20Select%20the%20field%20%22Reportlevel2%22%20in%20the%20dropdown%20of%20the%20filterpane%20and%20then%20uncheck%20%22(Blank)%22.%20Press%20OK.%20Repeat%20for%20field%20%22Reportlevel3%22.%3C%2FLINGO-BODY%3E
New Contributor

Hi Team,

 

I am looking for a solution to blank heading/subtotal rows in a pivot table with a multi level hierarchy. A label filter is an easy enough solution providing the (blank) label value is at the lowest level of the hierarchy, however if the (blank) label value is in one of the higher "grouping" levels the label filter will remove all the rows in the (blank) group.

 

In the attached chart of accounts there are 5 grouping levels, with 1 being the highest grouping level (Income Statement) and 5 being the individual posting account level. Where there is no grouping required for any intermediate level (level 2 to level 4) a subtotal for "(blank)" is created in the pivot table.

 

Is there a way to remove the heading/total for the (blank) categories from the pivot table, or is there a way to structure the chart of accounts to achieve this outcome, or a VBA solution, or are there any other alternatives that will get the result I am after? I am open to suggestions.

 

Thanks for your time.

 

Regards,

Alistair

9 Replies
Click on the filter dropdown in A1. Select the field "Reportlevel2" in the dropdown of the filterpane and then uncheck "(Blank)". Press OK. Repeat for field "Reportlevel3".

Thanks JKP, however if a filter is used to exclude "(blank)" for "ReportLevel2" then all the child records of "(blank)" are filtered out of the report. All the records need to remain in the report, it is just the heading and subtotal that I want removed.

 

If you open the file and do what you have suggested, the total of the income statement changes. The total of the income statement needs to remain the same.

 

Cheers.

Hi @Alistair Wallace 

Did you ever find a solution to this? I am grappling with the exact same problem. Would love to know what solution you found, if any.

Many thanks.

@ShogunPatch 

Afraid that doesn't work, if only (blank) replace with any other text within PivotTable

Hi @ShogunPatch, sorry mate no solution. You can structure the data so there is a value for each hierarchy, or live with the blanks, or not use a pivot table. I have been living with the blanks.

@Alistair Wallace , @Sergei Baklan OK, thank you both for your replies.  This must be a fairly common scenario/problem, so I'm amazed Microsoft haven't designed a solution to address this issue - it seems like a fairly simple and basic requirement.  Still, if that's the way it is then I guess I, too, will have to live with the blanks.  

Many thanks.

@ShogunPatch 

Requirement could be simple but solution is quite complex. To exclude from hierarchy levels with empty string in name is the same as to exclude level with any other text as name. 

 

Actually you need to rebuild hierarchy on the fly moving next levels upper if current level has empty string in name. Perhaps there are DAX samples, not sure.

@SergeiBaklan
I've been mulling my problem over and experimenting with my dataset since my last post and arrived (independently) at the same conclusion. In fact, I managed to do what I needed (I think - I'm still experimenting somewhat!) relatively simply using M code inside the power query which originally did the ETL on my data.

@ShogunPatch 

Would you please describe your solution?