# Calculated field in PivotTables

#### Hawjeen

##### New Member
Hi,

First time posting but been following for a while.

I have a problem i simply cant figure out how to fix.

In my pivot table, i have showed sales as % of grand total, for current year and previuos year, divided into categories and i want to show the difference through a calculated field.
but here comes my problem, i simply dont know how to refer to it the correct way, so it shows the delta between CY and LY.

usually it is enough to write "='CY'-'LY'" in calculated field, but that shows the differnce in the initial value, and not the differnce between the "% of grand total".

hope it is understandable and someone can hel.

regards
Hawjeen

### Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

#### oldbrewer

##### Well-known Member
 2016 2017 computers 2050 44.52 2300 49.95 printers 1405 30.51 1600 34.74 routers 750 16.29 900 19.54 keyboards 400 8.69 500 10.86 total 4605 5300 what is your question in terms of this layout ?

<colgroup><col width="64" span="7" style="width:48pt"> </colgroup><tbody>
</tbody>

#### Hawjeen

##### New Member
i want the equation 44.52-49.95 in a calculated field. i know it is pretty easy to do outside of the pivot, but i need it inside of the PT.

just for clarification i dont have the sales in my PT, eg. "2050". my "44.52" is shown through the setting for show value as % of grand total.

regards
Hawjeen

Replies
0
Views
38
Replies
0
Views
121
Replies
0
Views
205
Replies
0
Views
330
Replies
4
Views
354

1,128,075
Messages
5,628,498
Members
416,322
Latest member
Corbett

### 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.

### Which adblocker are you using?

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

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