Excel Add A Calculation To Each Pivot Table Subtotal Row Epsiode 2591

If you like this content, please consider visiting the video on YouTube and subscribe to the MrExcel Channel to show your support!
This video has been published on Apr 20, 2023.
Microsoft Excel tutorial on pivot tables.
Todd wants to calculate (12/52)*Sales on each subtotal row in a pivot table.
Bill shows how to add a calculated field to a pivot table and then uses some formatting to show the field only on the subtotal rows.

To download the data: Excel Add A Calculation To Each Pivot Table Subtotal Row Epsiode 2591 Sample Files - MrExcel Publishing

Table of Contents
(0:00) Formula outside of pivot table
(0:28) Calculated Field in Pivot Table
(1:11) Verify the calculation
(1:30) White Font trick
(1:55) When pivot table changes
(2:35) Wrap-up
maxresdefault.jpg


Transcript of the video:
Todd wants to add a calculation to each pivot table subtotal row.
Take a look at this pivot table that Todd sent me.
He has two items in the row fields here, Person and Project.
So we have Person subtotals after each group of Projects.
And Todd wants to do a calculation of 12 divided by 52, times sales at that subtotal row.
And currently, you can see it's just a formula outside of the pivot table.
And that's not really good because as we add more projects, those are going to move around. So here's my solution.
Select a cell inside the pivot table, and we want to be like on that Sum of Sales heading.
And then on the pivot table Analyze tab, Fields, Items & Sets, create a new Calculated field.
I don't know, what is it? Is this a bonus or an allocation?
Let's call it an allocation. I don't know actually what it is for Todd.
And so here we're going to say 12 divided by 52, times sales, which is going to do that at every single row in the underlying data. Click okay.
And let's just do a little test here. Equal 12 divided by 52, times the 74,141.
17,109.46.
All right, so right there, that number, that number, and those two numbers are the numbers that Todd wants to be in the pivot table, but he doesn't want all the other numbers.
I've thought about different ways to do this and unfortunately, the way that I came up with that is just the easiest to explain is select all of those cells and here in the font dropdown, choose a white font.
It looks really good. I mean, it looks like we did the right thing.
And if we just printed it, his manager's never going to know.
Now the place where this is going to come out, let's create a new project here.
So Andy will create a P99.
And then when I refresh the pivot table, yeah, we're going to have to go back and change the font on that extra cell to be white.
Yeah, I thought about editing the MDX, I thought about making a data model pivot table, I thought about DAX, but I think at the end of the day, the white font is probably the way to go.
Let me know what you think down in the YouTube comments. Do you have a better way?
I want to thank Todd for sending that question in, and I want to thank you for stopping by.
We'll see you next time for another net cast from MrExcel.
If you like these videos, please down below, like, subscribe, and ring the bell.
Feel free to post any questions or comments down in the comments below.
 

Forum statistics

Threads
1,221,498
Messages
6,160,160
Members
451,626
Latest member
dcobe

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