+ Reply to Thread
Results 1 to 10 of 10

Sum of Max instead of Max of Max in pivot table with grouping

  1. #1
    Registered User
    Join Date
    12-29-2016
    Location
    AbuDhabi
    MS-Off Ver
    2013
    Posts
    8

    Sum of Max instead of Max of Max in pivot table with grouping

    Hi,

    I have excel with Column A = Text, Column B = Text, Column C = Text, Column D = Number.

    I created pivot table Column A, B, C as Rows and Column D as Values and grouped rows.

    Now when i summarize the pivot table with sum, its giving me sum of all the numbers present in Column D, instead I need to show only sum of max number in each group.


    Please do help. I am very new to pivot table

  2. #2
    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: Sum of Max instead of Max of Max in pivot table with grouping

    Hi,

    You can have Sum or Max but not both in a regular pivot table. If you have Power Pivot available to you, it is possible to have the max at the detail level and sum those at the group level.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    12-29-2016
    Location
    AbuDhabi
    MS-Off Ver
    2013
    Posts
    8

    Re: Sum of Max instead of Max of Max in pivot table with grouping

    Hello,

    Thank you so much for responding so quickly.

    Can you please explain how to get sum at group level and max in detail level using power pivot?


    Thanks in Advance.

  4. #4
    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: Sum of Max instead of Max of Max in pivot table with grouping

    Can you provide an example workbook please- preferably with an example of the results you want from the data set just to be certain we are aiming at the same thing? The steps will most likely be easier to follow in the context of your file.

  5. #5
    Registered User
    Join Date
    12-29-2016
    Location
    AbuDhabi
    MS-Off Ver
    2013
    Posts
    8

    Re: Sum of Max instead of Max of Max in pivot table with grouping

    Please find below data for the sample.

    I tried to attach file but could not get option so copying the data.


    ColumnA ColumnB ColumnC ColumnD ColumnE
    PM004 ASAB 28-Jun 41 Jun
    PM004 ASAB 29-Jun 51 Jun
    PM004 ASAB 30-Jun 41 Jun
    PM032 ASAB 14-Jun 10 Jun
    PM032 ASAB 28-Jun 20 Jun
    PM032 ASAB 29-Jun 10 Jun
    PM032 ASAB 30-Jun 10 Jun


    Pivot Table :
    Row Labels Max of ColumnD
    Jun 51
    PM004 51
    ASAB 51
    28-Jun 41
    29-Jun 51
    30-Jun 41
    PM032 20
    ASAB 20
    14-Jun 10
    28-Jun 20
    29-Jun 10
    30-Jun 10

    I want sum of max in Jun group. That is when i group Jun i should see 71 not 51.



    Thanks

  6. #6
    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: Sum of Max instead of Max of Max in pivot table with grouping

    Here are the steps to achieve that for your layout
    1. Convert your data to a table (I will use Table1 as the name here)
    2. Load the table into the data model
    3. Create a pivot table and add the row fields you want
    4. Create a new measure named 'MaxValue' using the formula: =MAX(Table1[ColumnD])
    5. Create another new measure named MonthlyMax using the formula: =IF(COUNTROWS(VALUES(Table1[ColumnE]))=1,sumx(values(Table1[ColumnA]),[MaxValue]),[MaxValue])
    6. Add the MonthlyMax measure to the pivot table.

  7. #7
    Registered User
    Join Date
    12-29-2016
    Location
    AbuDhabi
    MS-Off Ver
    2013
    Posts
    8

    Re: Sum of Max instead of Max of Max in pivot table with grouping

    Looks great, Thank you for the solution

    But still its giving bit trouble.

    Formula : =IF(COUNTROWS(VALUES(Table1[ColumnE]))=1,sumx(values(Table1[ColumnA]),[MaxValue]),[MaxValue])

    giving the value as "#NAME?" in the Table1.

    Also =MAX([ColumnD]) gives only 51 in entire column MaxValue which should be 51 and 20 based on ColumnA as well.

    Can you please suggest on the same.

    Thank You

  8. #8
    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: Sum of Max instead of Max of Max in pivot table with grouping

    Those are not formulas to go into the source table. They are measures that you add to the pivot table.

  9. #9
    Registered User
    Join Date
    12-29-2016
    Location
    AbuDhabi
    MS-Off Ver
    2013
    Posts
    8

    Re: Sum of Max instead of Max of Max in pivot table with grouping

    Thanks a ton. It worked great

  10. #10
    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: Sum of Max instead of Max of Max in pivot table with grouping

    You're welcome.

+ 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 Grouping
    By farhanbutt1 in forum Excel General
    Replies: 3
    Last Post: 12-26-2016, 03:09 PM
  2. [SOLVED] Pivot Table Grouping
    By zanshin777 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-18-2015, 02:31 AM
  3. Replies: 1
    Last Post: 07-22-2015, 07:16 AM
  4. Pivot table grouping
    By SER01 in forum Excel General
    Replies: 3
    Last Post: 11-06-2007, 02:54 AM
  5. [SOLVED] Pivot table grouping
    By Philip Nelson in forum Excel General
    Replies: 4
    Last Post: 05-11-2006, 10:10 PM
  6. Pivot Table or Grouping Help
    By wnfisba in forum Excel General
    Replies: 0
    Last Post: 04-20-2006, 12:25 PM
  7. [SOLVED] Grouping in Pivot Table
    By Piotr in forum Excel General
    Replies: 2
    Last Post: 05-17-2005, 03:06 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