+ Reply to Thread
Results 1 to 5 of 5

Using unit prices in a calculated field

  1. #1
    Registered User
    Join Date
    06-02-2017
    Location
    London, England
    MS-Off Ver
    MS 365 Version 2308
    Posts
    14

    Using unit prices in a calculated field

    I have a calculated field that includes the use of two unit prices.

    The pivot table works perfectly when the lowest level of data is pivoted (for use in a chart) but when the pivot is used to aggregate data at a higher level (eg from Area to Region), the calculation produces spurious results.

    I have tried using MIN, MAX and AVERAGE to stop the pivot from aggregating the unit prices but I can't stop it.

    Example of calculation below.

    Grateful for suggestions on where I am going wrong.

    TIA

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,220

    Re: Using unit prices in a calculated field

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. The sample layout accurately matches that of your real data. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.

    Administrative Note:

    Is your forum profile showing the Excel PRODUCT that you need this to work for?

    Members will tailor the solutions they offer to the Office PRODUCT (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your product is for Mac, please also state this.

    The three most recent Excel products are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the version number in your profile (e.g. MS365 Version 2306). This is in the About Excel section further down the Account page.

    Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    06-02-2017
    Location
    London, England
    MS-Off Ver
    MS 365 Version 2308
    Posts
    14

    Re: Using unit prices in a calculated field

    Example workbook added as requested. To reiterate my question, I am not asking for comments on the calculated field formula as such, I need advice on how to stop the pivot table from aggregating the unit prices.
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,220

    Re: Using unit prices in a calculated field

    Understood, but that's why a workbook is useful - easier to diagnose a mechanical problem if you have the car in front of you with the bonnet open.

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

    Re: Using unit prices in a calculated field

    Depending on what calculation you are doing, you either have to do the calculation in the source data, or you have to use Power Pivot. In a normal pivot table, in a calculated field, any field is always summed before anything else happens, and you cannot stop that. Any kind of row-level calculations won't work.
    Everyone who confuses correlation and causation ends up dead.

+ 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. [SOLVED] Vali Unit Prices as per date range
    By erhanm in forum Excel General
    Replies: 3
    Last Post: 04-06-2022, 03:30 PM
  2. Replies: 3
    Last Post: 07-19-2016, 04:25 PM
  3. Replies: 0
    Last Post: 10-24-2013, 10:59 AM
  4. Replies: 7
    Last Post: 04-16-2013, 12:19 AM
  5. Need Help with coding that can reads unit prices on supermarkets websites.
    By Nickvii777 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-30-2013, 02:26 PM
  6. Replies: 3
    Last Post: 12-27-2012, 04:10 PM
  7. Replies: 0
    Last Post: 06-26-2012, 09:06 PM

Tags for this Thread

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