+ Reply to Thread
Results 1 to 7 of 7

Simple pivot table issue that I can't solve: how do I consolidate text?

  1. #1
    Registered User
    Join Date
    09-21-2018
    Location
    Toronto, Canada
    MS-Off Ver
    365
    Posts
    7

    Simple pivot table issue that I can't solve: how do I consolidate text?

    Hi guys!

    Let's suppose I have this very simple table:

    PivotTextGrouping-OrigTable.JPG

    What I want is to get the total revenue of all companies, while keeping their country name. In other words, this is my desired output:

    PivotTextGrouping-DesiredTable.JPG

    But when I created the pivot table as follows, I ended up with the "count" values of the "Location" column:

    PivotTextGrouping-PivotTable.JPG

    PivotTextGrouping-Fields.JPG


    What do I do to get the desired result (i.e.: the blue table)?

    Attached is the Excel file in question...

    Thanks!
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,691

    Re: Simple pivot table issue that I can't solve: how do I consolidate text?

    Pivot tables are for doing numeric analysis on data, not for organizing text. There are two options that I can think of (which means there are more options that I cannot think of).

    One is to move the Location underneath the Company, instead of making it a column. In your real data, can a single company have more than one location? I expanded your data and your pivot table to illustrate.

    Another is to use formulas instead of a pivot table. That is just a bit trickier so I don't want to spend the time on it if the reorganized pivot solves the problem.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Simple pivot table issue that I can't solve: how do I consolidate text?

    Hello and welcome to the forum.

    Drag Company and Location under ROWS and Revenue under VALUES
    Click on the Pivot Table > Design > Report Layout > Show in Tabular Form > Subtotals > Do Not Show Subtotals

    See attachment.

    That being said, this is not what Pivot Tables are for. I would use Power Query for this.
    Attached Files Attached Files

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Simple pivot table issue that I can't solve: how do I consolidate text?

    Here is how to do this through Power Query:

    Highlight A1:D5 > Data > From Table > Make sure "My table has headers" is checked > OK
    Home > Group By > Advanced > Add grouping > Group by: Company and Location > New column name: whatever > Operation: Sum > Column: Revenue > OK
    Drag the headers to reorder if you'd like then Home > Close & Load

    See attachment.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-21-2018
    Location
    Toronto, Canada
    MS-Off Ver
    365
    Posts
    7

    Re: Simple pivot table issue that I can't solve: how do I consolidate text?

    Quote Originally Posted by 6StringJazzer View Post
    Pivot tables are for doing numeric analysis on data, not for organizing text. There are two options that I can think of (which means there are more options that I cannot think of).

    One is to move the Location underneath the Company, instead of making it a column. In your real data, can a single company have more than one location? I expanded your data and your pivot table to illustrate.

    Another is to use formulas instead of a pivot table. That is just a bit trickier so I don't want to spend the time on it if the reorganized pivot solves the problem.


    Thanks so much 6StringJazzer! Seems like with this solution, I still can't get the location column to appear last, but nonetheless, it's a very decent solution....cheers! :-)

  6. #6
    Registered User
    Join Date
    09-21-2018
    Location
    Toronto, Canada
    MS-Off Ver
    365
    Posts
    7

    Re: Simple pivot table issue that I can't solve: how do I consolidate text?

    Quote Originally Posted by 63falcondude View Post
    Here is how to do this through Power Query:

    Highlight A1:D5 > Data > From Table > Make sure "My table has headers" is checked > OK
    Home > Group By > Advanced > Add grouping > Group by: Company and Location > New column name: whatever > Operation: Sum > Column: Revenue > OK
    Drag the headers to reorder if you'd like then Home > Close & Load

    See attachment.

    Thanks so much 63falcondude! This is an absolutely brilliant solution.....perfect! I never even knew Power Query exists in Excel (it's unbelievable how many features Excel has!!) Now I'll go ahead and learn more about Power Query

    Cheers!

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Simple pivot table issue that I can't solve: how do I consolidate text?

    You're welcome. Thanks for the rep!

    Power Query is great. All that you have to do when you add new data to the bottom of the table is refresh the Power Query table.

+ 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: 7
    Last Post: 12-15-2017, 12:14 AM
  2. Replies: 2
    Last Post: 03-28-2017, 03:38 PM
  3. Replies: 1
    Last Post: 06-02-2016, 01:58 PM
  4. [SOLVED] how do I consolidate multiple pivot tables into one pivot table?
    By pkahm in forum Excel General
    Replies: 0
    Last Post: 04-20-2006, 04:50 PM
  5. Solve Order of a CalculatedField in a Pivot Table
    By Gary L Brown in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2005, 05:05 PM
  6. Solve Order of a CalculatedField in a Pivot Table
    By Gary L Brown in forum Excel General
    Replies: 0
    Last Post: 08-25-2005, 09:05 AM
  7. Solve Order of a CalculatedField in a Pivot Table
    By Gary L Brown in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-24-2005, 02:05 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