Aug 10 2023 04:36 AM - edited Aug 14 2023 12:12 AM
Hello together,
I have the following problem. I have sales figures of my company displayed in a pivot table, based on the year. Unfortunately, I only have one field in which the turnover is displayed, which is why it is not possible for me to create a difference between year 2023 and year 2022. Is there a way to create a difference, possibly using an auxiliary table, etc.? See also the screenshots. Unfortunatly I can not get the data based on the year because I just get every sales line from our system with a certain buyer and date where it has been bought.
This is the Pivot table where a Sum is drawn based on the Item and the year.
Aug 10 2023 05:09 AM
Click on 2022 or 2023.
On the PivotTable analyze tab of the ribbon, click Fields, Items & Sets > Calculated Item...
In the Name box, enter Difference or something similar.
In the Formula box, enter =Year[2023]-Year[2022]
(This syntax is necessary because 2022 and 2023 are numbers. If you entered =2023-2022, the result would be 1)
Click Add, then click OK.
Aug 11 2023 02:27 AM
@Hans Vogelaar Hi and thanks for the quick reply. Unfortunatly Excel can't address the Year field. I get the following error:
Aug 11 2023 03:54 AM
Aug 13 2023 11:37 PM
Aug 13 2023 11:58 PM
Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?
Aug 14 2023 12:13 AM
Aug 14 2023 02:00 AM
SolutionThis worked for me: ='2023'-'2022'
I have attached the workbook, but you'll want to create the formula yourself, since the labels were changed to English in my version.
Note that I turned off the grand total for rows, because Excel would include the Differenz value in the grand total.
Aug 14 2023 02:56 AM
Aug 14 2023 03:20 AM
I clicked on 2023 (2022 would have been OK too), then selected Fields, Items & Sets > Calculated Item...