Pivot Chart - Mean Line

*shudder*

Well-known Member
Joined
Aug 20, 2009
Messages
510
Office Version
  1. 2016
Platform
  1. Windows
Hi Guys,

I have been searching around for an answer to this for a couple of hours and struggling to find a solution.

I would like to add a dynamic mean line into a pivot table/chart dependent on which department and month I am looking at.

Source data is set out like this where I have a formula to calculate the average:

Name
Dept
Month
Volume
Average
One

AA
January

<tbody>
[TD="width: 125, bgcolor: transparent"] 10
[/TD]
[TD="width: 111, bgcolor: transparent"] 25
[/TD]

[TD="width: 122, bgcolor: transparent"] Two

[/TD]
[TD="width: 119, bgcolor: transparent"] AA
[/TD]
[TD="width: 125, bgcolor: transparent"] January
[/TD]
[TD="width: 125, bgcolor: transparent"] 15
[/TD]
[TD="width: 111, bgcolor: transparent"] 25
[/TD]

[TD="width: 122, bgcolor: transparent"] Three

[/TD]
[TD="width: 119, bgcolor: transparent"] AA
[/TD]
[TD="width: 125, bgcolor: transparent"] January
[/TD]
[TD="width: 125, bgcolor: transparent"] 50
[/TD]
[TD="width: 111, bgcolor: transparent"] 25
[/TD]

[TD="width: 122, bgcolor: transparent"] Four

[/TD]
[TD="width: 119, bgcolor: transparent"] BB
[/TD]
[TD="width: 125, bgcolor: transparent"] January
[/TD]
[TD="width: 125, bgcolor: transparent"] 20
[/TD]
[TD="width: 111, bgcolor: transparent"] 73

[/TD]

[TD="width: 122, bgcolor: transparent"] Five

[/TD]
[TD="width: 119, bgcolor: transparent"] BB
[/TD]
[TD="width: 125, bgcolor: transparent"] January
[/TD]
[TD="width: 125, bgcolor: transparent"] 50
[/TD]
[TD="width: 111, bgcolor: transparent"] 73

[/TD]

[TD="width: 122, bgcolor: transparent"] Six

[/TD]
[TD="width: 119, bgcolor: transparent"] BB
[/TD]
[TD="width: 125, bgcolor: transparent"] January
[/TD]
[TD="width: 125, bgcolor: transparent"] 150
[/TD]
[TD="width: 111, bgcolor: transparent"] 73

[/TD]

[TD="width: 122, bgcolor: transparent"] One

[/TD]
[TD="width: 119, bgcolor: transparent"] AA
[/TD]
[TD="width: 125, bgcolor: transparent"] February
[/TD]
[TD="width: 125, bgcolor: transparent"] 15
[/TD]
[TD="width: 111, bgcolor: transparent"] 15
[/TD]

[TD="width: 122, bgcolor: transparent"] Two

[/TD]
[TD="width: 119, bgcolor: transparent"] AA
[/TD]
[TD="width: 125, bgcolor: transparent"] February
[/TD]
[TD="width: 125, bgcolor: transparent"] 10
[/TD]
[TD="width: 111, bgcolor: transparent"] 15
[/TD]

[TD="width: 122, bgcolor: transparent"] Three

[/TD]
[TD="width: 119, bgcolor: transparent"] AA
[/TD]
[TD="width: 125, bgcolor: transparent"] February
[/TD]
[TD="width: 125, bgcolor: transparent"] 20
[/TD]
[TD="width: 111, bgcolor: transparent"] 15
[/TD]

[TD="width: 122, bgcolor: transparent"] Four

[/TD]
[TD="width: 119, bgcolor: transparent"] BB
[/TD]
[TD="width: 125, bgcolor: transparent"] February
[/TD]
[TD="width: 125, bgcolor: transparent"] 30
[/TD]
[TD="width: 111, bgcolor: transparent"] 40
[/TD]

[TD="width: 122, bgcolor: transparent"] Five

[/TD]
[TD="width: 119, bgcolor: transparent"] BB
[/TD]
[TD="width: 125, bgcolor: transparent"] February
[/TD]
[TD="width: 125, bgcolor: transparent"] 40
[/TD]
[TD="width: 111, bgcolor: transparent"] 40
[/TD]

[TD="width: 122, bgcolor: transparent"] Six

[/TD]
[TD="width: 119, bgcolor: transparent"] BB
[/TD]
[TD="width: 125, bgcolor: transparent"] February
[/TD]
[TD="width: 125, bgcolor: transparent"] 50
[/TD]
[TD="width: 111, bgcolor: transparent"] 40
[/TD]

</tbody>

With the pivot table data currently looking like this with slicers for Name, Department and Month:

Name

Volume
Average

One

10
25

Two

15

<tbody>
[TD="width: 111, bgcolor: transparent"] 25

[/TD]

[TD="width: 122, bgcolor: transparent"] Three

[/TD]
[TD="width: 125, bgcolor: transparent"] 12
[/TD]
[TD="width: 111, bgcolor: transparent"] 25
[/TD]

[TD="width: 122, bgcolor: transparent"] Four

[/TD]
[TD="width: 125, bgcolor: transparent"] 20
[/TD]
[TD="width: 111, bgcolor: transparent"] 73

[/TD]

[TD="width: 122, bgcolor: transparent"] Five

[/TD]
[TD="width: 125, bgcolor: transparent"] 50
[/TD]
[TD="width: 111, bgcolor: transparent"] 73

[/TD]

[TD="width: 122, bgcolor: transparent"] Six

[/TD]
[TD="width: 125, bgcolor: transparent"] 150
[/TD]
[TD="width: 111, bgcolor: transparent"] 73

[/TD]

</tbody>

What I would like the pivot table to do is adjust theaverage/mean dependant on which slicer items are selected i.e.


Slicer Selections
Dept: AA
Month: January
Name: One, Two

Pivot would show

Name

Volume
Average
One

10
12.5
Two

15

<tbody>
[TD="width: 111, bgcolor: transparent"] 12.5
[/TD]

</tbody>

Thanks in advance


Stuart
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,223,627
Messages
6,173,425
Members
452,515
Latest member
Alicedonald9

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