+ Reply to Thread
Results 1 to 4 of 4

PowerPivot - problems adding multiple calculated fields (measures)

  1. #1
    Registered User
    Join Date
    04-19-2017
    Location
    UK
    MS-Off Ver
    2013
    Posts
    2

    PowerPivot - problems adding multiple calculated fields (measures)

    Hi,
    I have a PowerPivot table with Dates in the Columns area, SalesPerson in the Rows area, and a measure to calculate Total_Sales in the values area...
    1st April 2nd April 3rd April Total_Sales
    John 5 10 9 24
    Sarah 10 15 2 27
    Mike 0 6 12 18

    I wish to add a second measure that will display the Average_Sales for each person. When I add the measure to the Values area, I get the following result...

    1st April 2nd April 3rd April Total_Sales Average_Sales
    Total_Sales Average_Sales Total_Sales Average_Sales Total_Sales Average_Sales
    John 5 5 10 10 9 9 24 8
    Sarah 10 10 15 15 2 2 27 9
    Mike 0 0 6 6 12 12 18

    Is it possible to only show the Average Sales in the far right hand column, and not show both measures for each individual date? The kind of result I hope to achieve is something like this...

    1st April 2nd April 3rd April Total_Sales Average_Sales
    John 5 10 9 24 8
    Sarah 10 15 2 27 9
    Mike 0 6 12 18

    Is this possible, bearing in mind that the pivot will increase in size as a new date gets added each day?

    Thanks for any help or advice you may be able to offer.
    Best wishes,
    Gary

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: PowerPivot - problems adding multiple calculated fields (measures)

    Create an explicit measure for average sales, which only returns an average if more than one Date exists in context:
    Please Login or Register  to view this content.
    See attachment for worked example.
    Attached Files Attached Files
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    04-19-2017
    Location
    UK
    MS-Off Ver
    2013
    Posts
    2

    Re: PowerPivot - problems adding multiple calculated fields (measures)

    Hi Olly,

    Apologies for the slight delay in responding. I've been moving to another home and have not had access to a computer.

    Your solution works perfectly - thank you very much for your help. I wish you could see the big smile on my face right now!

    Best wishes,
    Gary

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: PowerPivot - problems adding multiple calculated fields (measures)

    Happy to help - thanks for the feedback

+ 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. adding calculated PowerPivot field to Pivot Table
    By AtlanteanIdol in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-09-2017, 09:49 AM
  2. Help with VB code to remove measures and row labels from PowerPivot tables
    By rv02 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-24-2016, 10:12 AM
  3. understanding calculated fields in powerpivot
    By stephme55 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-28-2016, 01:28 PM
  4. Keep Calculated Column Next to Pivot When Adding fields
    By beckms in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 05-23-2014, 04:46 PM
  5. Replies: 0
    Last Post: 06-22-2012, 07:13 AM
  6. [SOLVED] Adding Calculated Fields to a Pivot Table Code
    By dwhite30518 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2012, 06:36 PM
  7. Adding Calculated Fields/Formulas to a Pivot Table
    By SigueSigue in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-25-2011, 08:27 AM

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