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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,224,822
Messages
6,181,165
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