+ Reply to Thread
Results 1 to 6 of 6

Calculated Field in Pivot Table

  1. #1
    Registered User
    Join Date
    04-05-2016
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Microsoft Office Professional Plus 2013
    Posts
    40

    Calculated Field in Pivot Table

    Hi All,

    I've got a pivot table showing sales data from two years (however, the numbers are in the same column in the raw data).

    Capture.PNG

    Capture2.PNG

    I'm trying to create a calculated field where I subtract the 2017 numbers from the 2016 numbers, but I can't figure out how to do it since it's the same field. Essentially, I'm looking to subtract 2016 Sum of Sls Qty US Pound from 2017 Sum of Sls Qty US Pound. Any ideas?

    Thanks!

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Calculated Field in Pivot Table

    This sounds like a case where you may have to tinker with the source data and add a couple of helper columns. Or you could probably do it with formulas using SUMIFS.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Calculated Field in Pivot Table

    Hi,

    What you need is actually a calculated item rather than a calculated field, but it will display the difference for all value fields and not just one of them.

    If the data is loaded to the data model, you may be able to achieve the desired outcome using a Set.
    Last edited by xlnitwit; 03-20-2017 at 12:23 PM.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Calculated Field in Pivot Table

    Your desired results are in a well-defined format, so I think you can use formulas rather than a pivot table to get the results. If you can provide some sample data, it would help a lot.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  5. #5
    Registered User
    Join Date
    04-05-2016
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Microsoft Office Professional Plus 2013
    Posts
    40

    Re: Calculated Field in Pivot Table

    I've attached a sample of the data and a sample of what I would like the pivot table to turn out as. I know this can be done without a pivot table, however, my client would like for it to be in a pivot table (outside of my control). What I can't figure out how to produce is the Difference and & %Difference columns. I am having trouble because I can't create a calculated field that reads Sales-Sales.

    I am open to any suggestions, however, I don't know much about calculated items or sets....willing to learn though!
    Attached Files Attached Files

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Calculated Field in Pivot Table

    Well, if your boss absolutely insists on a pivot table, then we need some helper columns in the source data to make this happen. Take a look at what I did in columns F & G. I duplicated the desired out come on Sheet1 to make it easier for me to QA.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Pivot Table Calculated Field: Different categories in the same field
    By happydays886 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-08-2016, 09:49 PM
  2. Pivot Table: Calculated Field based on Running Total Field
    By EvolvingMonkey in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-07-2016, 06:27 AM
  3. Replies: 0
    Last Post: 08-15-2016, 02:07 PM
  4. [SOLVED] A pivot table field calculated using other field values as fields?
    By chrisf78 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 05-07-2015, 03:08 AM
  5. [SOLVED] Referring to a Sub-Field on Calculated Field Pivot Table Column?
    By figo12 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-27-2014, 02:02 PM
  6. Replies: 0
    Last Post: 06-26-2012, 09:06 PM
  7. [SOLVED] pivot table formulas for calculated field or calculated item
    By Vicky in forum Excel General
    Replies: 3
    Last Post: 06-06-2006, 12:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1