+ Reply to Thread
Results 1 to 10 of 10

Calculated Fields in Pivot Tables

  1. #1
    Forum Contributor
    Join Date
    07-14-2014
    Location
    New City, NY
    MS-Off Ver
    MS 365
    Posts
    194

    Calculated Fields in Pivot Tables

    Hello,

    I am trying to insert a calculated field in a pivot table but for some reason its showing the wrong totals. The formula I am using is Quantity * Price

    the only caveat is the price is different for each customer. Would this throw the totals off?

    in the attached file I am looking for the calculated field to show total contract sales of $3,672.49 but its showing $87,637.42

    Thanks,
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Calculated Fields in Pivot Tables

    Rather than the calculated field use the total value fields from the data.

    See attached
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    07-14-2014
    Location
    New City, NY
    MS-Off Ver
    MS 365
    Posts
    194

    Re: Calculated Fields in Pivot Tables

    Thanks Richard. I guess there is no way to do this within the pivot itself?

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Calculated Fields in Pivot Tables

    Quote Originally Posted by Philipsfn View Post
    Thanks Richard. I guess there is no way to do this within the pivot itself?
    You can do this with a calculated field

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then in the Sum of Calculated Field Values choose Running Totals in Product ID

  5. #5
    Forum Contributor
    Join Date
    07-14-2014
    Location
    New City, NY
    MS-Off Ver
    MS 365
    Posts
    194

    Re: Calculated Fields in Pivot Tables

    Thanks Richard. I tried that but it wont display the total in the bottom. Please see attached. Contract Sales 2 column. Thanks
    Attached Files Attached Files

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,983

    Re: Calculated Fields in Pivot Tables

    You need to load the data into the data model so that you can create the measure you need. In a normal pivot table, the formula equates to =SUM(Quantity)*SUM(Price) and you can't alter that.
    Everyone who confuses correlation and causation ends up dead.

  7. #7
    Forum Contributor
    Join Date
    07-14-2014
    Location
    New City, NY
    MS-Off Ver
    MS 365
    Posts
    194

    Re: Calculated Fields in Pivot Tables

    Thanks for your response. Yes, I get that by doing the calculation in a separate column in the data I can bring that into the pivot but I was wondering as to why the calculated filed does not sum correctly?

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,983

    Re: Calculated Fields in Pivot Tables

    It does sum correctly, just not the way you want. Calculated fields always operate on the aggregated totals of the fields involved.

  9. #9
    Forum Contributor
    Join Date
    07-14-2014
    Location
    New City, NY
    MS-Off Ver
    MS 365
    Posts
    194

    Re: Calculated Fields in Pivot Tables

    Great. Thanks

  10. #10
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,983

    Re: Calculated Fields in Pivot Tables

    Glad to help, and thanks for the rep. (BTW, you don't need to write an essay in the rep comments - a simple thanks is sufficient )

+ 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. Calculated Fields in Pivot Tables
    By nicoan in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-10-2014, 02:35 PM
  2. Calculated Fields in Pivot Tables
    By verramilli in forum Excel General
    Replies: 5
    Last Post: 04-14-2012, 12:02 AM
  3. Calculated Fields in Pivot Tables
    By RobertL in forum Excel General
    Replies: 1
    Last Post: 07-06-2007, 07:50 PM
  4. Pivot Tables - how do I add in calculated fields?
    By ColinS via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-06-2006, 12:45 PM
  5. [SOLVED] Calculated Fields in Pivot Tables
    By Pelham in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-04-2006, 08:10 AM
  6. [SOLVED] Calculated fields in Pivot Tables
    By lj in forum Excel General
    Replies: 2
    Last Post: 11-15-2005, 06:20 AM
  7. [SOLVED] pivot tables - calculated fields
    By Esche in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-26-2005, 05:15 PM

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