+ Reply to Thread
Results 1 to 2 of 2

Create calculated field by combining original row values, not on field in pivot

  1. #1
    Registered User
    Join Date
    06-26-2019
    Location
    Dublin, Ireland
    MS-Off Ver
    MS Excel for Mac, Vs 16.16.9
    Posts
    1

    Create calculated field by combining original row values, not on field in pivot

    Hi there,

    I'm trying to create a weighted allocation view in a pivot table based on combination of two set of values from the original table. Essentially I have a series of sales people, each belonging to a sales team, and that could be allocated to multiple sales region and to multiple products. I represented the allocation as a % of time spent (e.g., in the sample file attached, sales rep A is dedicated 90% to region NAR and 10% to EMEA, and spend 40% of his time selling Product A, and 60% of his time selling product B).

    My goal is to produce a pivot that, for each sales team, shows what is the overall resources allocation by product for a given region. As in reality I have a lot more than 3 regions and 3 products, I want to do this calculation in the pivot rather than creating ad hoc columns in my original dataset. So for instance, based on values in the attached file, my aim get something like:

    team EMEA resources Prod.A EMEA Prod.B EMEA Prod.C EMEA
    BLU 1.5 1.1 0.3 0.1
    GREEN 3.5 1.4 1 1.1
    ORANGE 0.1 0.04 0.04 0.02

    I was trying to get that through a calculated field (Prod.X EMEA = EMEA*Prod.X), but because the calculated field combines the sum of totals, rather than the individual lines, it skews all the values (see sheet 2 of attachment), because it sums all values instead of "zeroing" the rows where either EMEA or the product is equal to zero for a given sales rep.
    Any suggestion on what I could use? As said, I dont want to create 9 extra fields on sheet1 with all the calculations, as in reality I'll be dealing with a much larger set of product and regions, so it's not a scalable option.

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Create calculated field by combining original row values, not on field in pivot

    Hello CarManI and Welcome to Excel Forum.
    As you have the 2016 version of Excel the following may be helpful.
    Using Power Query (Get & Transform) two tables are produced, tbl_Percent_by_Region and tbl_Percent_by_Product.
    Again using Power Query the two tables are merged using both the Sales Rep and Sales Team columns as matching.
    Once the tbl_All_Data table is produced a new column is added that multiplies the Region percent and Product percent using: =[@[Reg. Percent]]*[@[Prod. Percent]]
    From tbl_All_Data a pivot table is produced with the Sales Teams and Regions in the Row field, the Products in the column field and the Reg. x Prod. Percent in the values field.
    In the attached file the filter for the Region field is set to display only EMEA, however it could show any/all of the other regions as well.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Replies: 1
    Last Post: 01-15-2019, 08:54 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. Replies: 1
    Last Post: 12-21-2012, 05:40 AM
  6. Replies: 0
    Last Post: 06-26-2012, 09:06 PM
  7. Pivot Table VBA - Data Field - Original (source) field name
    By hbgpausa0 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-22-2008, 10:25 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