Calculated Field

WGarrison

Board Regular
Joined
Sep 9, 2008
Messages
52
Hello Everyone. I am trying to analyze Year over Year Sales in a Pivot Table. I have struck out with conditional formatting so now I am playing around with Calculated Fields. One would think this was easy....I have proven it is not.

I want to simply subtract 2024 v 2023. I should either have a positive or negative number indicating growth or loss. When I try to use Calculated Fields, I cannot find the fields that would populate the values I need to subtract (my annual sales results). I am doing something wrong and could use some assistance, please.

I have attached not only a snip of my pivot table but also the way I have the fields laid out. I am going to assume, it is my PivotTable Fields not set up properly to allow me to do this calculation.

Thank you,
 

Attachments

  • Data Set.png
    Data Set.png
    11.1 KB · Views: 16
  • Design.png
    Design.png
    19.4 KB · Views: 16

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
The year 2023 and Year 2024 are not fields, but categories of a field i.e. "year". To show the difference between 2023 and 2024 you'd have to duplicate the table
and right-click -> summarize values as -> more options -> show data as -> difference from -> base field = year -> base item = previous.
Note that this would effect the whole table not just the grand total.
 
Upvote 0
The year 2023 and Year 2024 are not fields, but categories of a field i.e. "year". To show the difference between 2023 and 2024 you'd have to duplicate the table
and right-click -> summarize values as -> more options -> show data as -> difference from -> base field = year -> base item = previous.
Note that this would effect the whole table not just the grand total.
That worked - is there a way to keep the integrity of the 2023 and 2024 results and show that calculation in a 3rd column?
 
Upvote 0
To my knowledge, there isn't. You can hide the extra columns in between and re-format a bit to make it look like 1 table.
 
Upvote 0
As @Cubist pointed out because your year is in a column (which is a good thing), they are not separate fields the are "items" in a field.
If you click on any cell in year column or the heading for that column, under Field, Items & Set there should be a Calculated Item option.
You can calculate the difference there. The downside is that you will be hard coding the 2 years so unlike using vs Previous or Next it will need automatically pick up the 2 new years next year.

1714626459775.png
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,213
Members
452,618
Latest member
Tam84

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