Pivot Table - Multiple Column Headers Merging After Filtering

Jhuck

New Member
Joined
May 15, 2019
Messages
5
Hi everyone,

I am having issues with a pivot table merging 2 column headers and count of values together when I filter out Blanks.


I've created an example workbook of the source data, what I'm doing (which is definitely wrong), and an example of what I want it to look like. https://www.dropbox.com/sh/1wky1or8aj1j7l7/AACD_KIYI5-NUPK_Ngz40tZ6a?dl=0

On top of this I need it to be able to refresh the pivot table without reformatting as part of a macro (I can write in the refresh)

I appreciate any help or advice you have! Thanks!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
is that what you want
(with PowerQuery aka Get&Transform)

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td]source[/td][td][/td][td][/td][td][/td][td][/td][td]Pivot with PQ[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#5B9BD5]Area[/td][td=bgcolor:#5B9BD5]Store[/td][td=bgcolor:#5B9BD5]RB[/td][td=bgcolor:#5B9BD5]TMT[/td][td][/td][td=bgcolor:#DDEBF7]Count of Value[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Area 1[/td][td=bgcolor:#DDEBF7]Store A[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7]Action Required[/td][td][/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7]RB[/td][td=bgcolor:#DDEBF7]RB[/td][td=bgcolor:#DDEBF7]RB[/td][td=bgcolor:#DDEBF7]TMT[/td][td=bgcolor:#DDEBF7]TMT[/td][/tr]

[tr=bgcolor:#FFFFFF][td]Area 1[/td][td]Store B[/td][td]Action Required[/td][td]Action Required[/td][td][/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7]Action Required[/td][td=bgcolor:#DDEBF7]Reminder[/td][td=bgcolor:#DDEBF7]First Day[/td][td=bgcolor:#DDEBF7]Action Required[/td][td=bgcolor:#DDEBF7]Reminder[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Area 1[/td][td=bgcolor:#DDEBF7]Store B[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7]Action Required[/td][td][/td][td]Area 1[/td][td]Store A[/td][td][/td][td][/td][td][/td][td]
1​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]Area 1[/td][td]Store C[/td][td]Action Required[/td][td][/td][td][/td][td]Area 1[/td][td]Store B[/td][td]
1​
[/td][td][/td][td][/td][td]
2​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Area 1[/td][td=bgcolor:#DDEBF7]Store C[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7]Reminder[/td][td][/td][td]Area 1[/td][td]Store C[/td][td]
1​
[/td][td][/td][td][/td][td]
3​
[/td][td]
2​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]Area 1[/td][td]Store C[/td][td][/td][td]Reminder[/td][td][/td][td]Area 2[/td][td]Store D[/td][td]
1​
[/td][td]
1​
[/td][td][/td][td]
2​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Area 1[/td][td=bgcolor:#DDEBF7]Store C[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7]Action Required[/td][td][/td][td]Area 3[/td][td]Store E[/td][td][/td][td][/td][td][/td][td]
3​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]Area 1[/td][td]Store C[/td][td][/td][td]Action Required[/td][td][/td][td]Area 3[/td][td]Store F[/td][td][/td][td]
1​
[/td][td]
1​
[/td][td]
1​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Area 1[/td][td=bgcolor:#DDEBF7]Store C[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7]Action Required[/td][td][/td][td]Area 3[/td][td]Store G[/td][td]
1​
[/td][td][/td][td][/td][td]
1​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]Area 2[/td][td]Store D[/td][td]Action Required[/td][td]Action Required[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Area 2[/td][td=bgcolor:#DDEBF7]Store D[/td][td=bgcolor:#DDEBF7]Reminder[/td][td=bgcolor:#DDEBF7][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]Area 2[/td][td]Store D[/td][td][/td][td]Action Required[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Area 3[/td][td=bgcolor:#DDEBF7]Store E[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7]Action Required[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]Area 3[/td][td]Store E[/td][td][/td][td]Action Required[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Area 3[/td][td=bgcolor:#DDEBF7]Store E[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7]Action Required[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]Area 3[/td][td]Store F[/td][td][/td][td]Action Required[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Area 3[/td][td=bgcolor:#DDEBF7]Store F[/td][td=bgcolor:#DDEBF7]Reminder[/td][td=bgcolor:#DDEBF7][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]Area 3[/td][td]Store F[/td][td]First Day[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Area 3[/td][td=bgcolor:#DDEBF7]Store G[/td][td=bgcolor:#DDEBF7]Action Required[/td][td=bgcolor:#DDEBF7]Action Required[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[/table]
 
Upvote 0
You are welcome

Now you can hit Like/Thanks button in the posts which helped you ;)

Have a nice day
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,170
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top