+ Reply to Thread
Results 1 to 9 of 9

Adding a pivot filter based on values from multiple columns

  1. #1
    Registered User
    Join Date
    09-16-2021
    Location
    New York, NY
    MS-Off Ver
    Office 365
    Posts
    9

    Adding a pivot filter based on values from multiple columns

    Hello and thank you for giving this a look.

    I am wondering whether it is possible to add a filter in the attached pivot where I could select either sum of total sales or sum for any of the 5 individual company sales.

    Any help you can offer will be greatly appreciated.

    Best,
    YevD
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Adding a pivot filter based on values from multiple columns

    If I am understanding correctly, then try with a Slicer as shown in the attached. To see all sales, do not select any region. To see only a specific region, then select it. To see multiple regions, select multiple.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    09-16-2021
    Location
    New York, NY
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Adding a pivot filter based on values from multiple columns

    Hi Alan, thanks for the reply. Sorry if this wasn't very clear. I'd like to have a single filter or slicer that would have a selection for Company 1 Sales, Company 2 Sales, 3, 4, 5, & Total Sales - so when each is selected the sum of sales in the table will update accordingly.

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

    Re: Adding a pivot filter based on values from multiple columns

    The data as arranged on Sheet1 is not conducive to producing the output you are looking for, however as you have the 365 version of Excel you could use Get & Transform to produce a data set that is.
    First convert the data on Sheet1 into an Excel table (Ctrl + t)
    The following Advanced Editor code puts the data into record format:
    Please Login or Register  to view this content.
    Note that the Total Sales column is removed.
    The resulting table and corresponding pivot table are displayed on the Sales Table sheet.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    09-16-2021
    Location
    New York, NY
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Adding a pivot filter based on values from multiple columns

    Apologies on a delayed response. Your code seems like almost exactly what I ended up doing - I unpivoted the company sales columns in Excel query editor while keeping total unchanged. This allowed me to create a pivot table with a single filter providing options for total and individual companies.

  6. #6
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Adding a pivot filter based on values from multiple columns

    This message went wrong and could be deleted.
    Last edited by DJunqueira; 12-02-2021 at 02:54 AM.

  7. #7
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Adding a pivot filter based on values from multiple columns

    Just playing with the visualization of a Pivot Table.

  8. #8
    Registered User
    Join Date
    09-16-2021
    Location
    New York, NY
    MS-Off Ver
    Office 365
    Posts
    9

    Re: Adding a pivot filter based on values from multiple columns

    This is exactly it. Thank you!

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Adding a pivot filter based on values from multiple columns

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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: 6
    Last Post: 08-19-2015, 07:46 PM
  2. Replies: 8
    Last Post: 06-24-2014, 03:35 PM
  3. Filter A Pivot Table Multiple Times Based On Values In List In Another Sheet
    By w.m.christensen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-24-2013, 03:55 AM
  4. Pivot Table based on specific values from multiple columns
    By Jaypoc in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 06-22-2013, 12:33 PM
  5. Filter rows based on cell values in multiple columns
    By dionaqld1 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-25-2012, 09:13 AM
  6. Change Pivot table Filter Based on Cell Value *Multiple Filter items* Possible?
    By Flydd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-27-2012, 06:57 AM
  7. Filter based on values of multiple columns
    By learning in forum Excel General
    Replies: 8
    Last Post: 09-29-2009, 03:17 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