+ Reply to Thread
Results 1 to 6 of 6

Pivot: Filter parent row by child row results?

  1. #1
    Registered User
    Join Date
    03-14-2019
    Location
    Rochester, NY
    MS-Off Ver
    2016
    Posts
    3

    Pivot: Filter parent row by child row results?

    Is it possible to filter a pivot table such that a parent row is omitted upon the presence of a child value? In this example, we'd like to report on the customers only running older versions of a product.

    Consider the following (simplified) data in which Customer1 only has old product, Customer2 only has new product, and Customer3 has both old and new product. We'd like to filter the data to only report on Customer 1.

    Customer Version Ticket#
    Customer1 old 1
    Customer1 old 2
    Customer1 old 3
    Customer1 old 4
    Customer2 new 5
    Customer2 new 6
    Customer2 new 7
    Customer2 new 8
    Customer3 old 9
    Customer3 old 10
    Customer3 new 11
    Customer3 new 12

    A simple pivot might appear as:
    2019-03-14_14-26-04.jpg

    OR

    2019-03-14_13-14-02.jpg

    Can I filter out any customers with New products?

    Appreciate the help!

    David
    Last edited by dp_stickney; 03-14-2019 at 02:41 PM.

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Pivot: Filter parent row by child row results?

    Have you tried using the filter against 'Row Labels'?

  3. #3
    Registered User
    Join Date
    03-14-2019
    Location
    Rochester, NY
    MS-Off Ver
    2016
    Posts
    3

    Re: Pivot: Filter parent row by child row results?

    Thank you for the reply kersplash!

    I want to filter out customers based on the existence (a count) of new products, not by name. It seems like my best bet for row filtering is the format below where each customer is presented on a single row which describes their holdings of new and old products. However, my best attempts still include Customer3 who has both old and new products.

    2019-03-15_8-19-22.jpg

    2019-03-14_14-26-04.jpg

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Pivot: Filter parent row by child row results?

    There's no direct way with standard Pivot Table.

    Couple of methods.
    1. Use DAX and PowerPivot (based on data model). DAX measure can be written to return null when Customer has New. Thus, filtering them out from Pivot Table.
    Note: You can also use calculated column to use as filter flag in the model.

    2. Add helper column in source table.
    Ex: =COUNTIFS($A$2:$A$13,A2,$B$2:$B$13,"new")=0

    Add it to your pivot's filter field, or use slicer.

    0.JPG
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  5. #5
    Registered User
    Join Date
    03-14-2019
    Location
    Rochester, NY
    MS-Off Ver
    2016
    Posts
    3

    Re: Pivot: Filter parent row by child row results?

    CK76, the helper column will meet my needs. Thank you for setting me straight on the fact that I could not achieve this goal with standard pivot tables. It seemed like I might be able to get there, but I could never quite do it. I am not familiar with DAX, but it may have to be on my list of things to do. It seems pretty powerful.

    Appreciate the feedback by all!

    David

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Pivot: Filter parent row by child row results?

    You are welcome

    If your issue is resolved. Please mark the thread as solved by using thread tools found at top of your initial post.

+ 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. parent and child reports with vba
    By jondidi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-18-2019, 10:42 PM
  2. [SOLVED] Parent Child relationship issue: Get parent ID for child
    By masterl1983 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-28-2018, 07:35 AM
  3. [SOLVED] Sorting with Parent and Child
    By dominict in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-04-2013, 06:56 AM
  4. [SOLVED] Parent child relationships(working out parent item) for each item
    By grphillips in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-21-2013, 05:58 AM
  5. Parent Child Relationship
    By Automation Guru in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-02-2013, 04:48 AM
  6. Parent Child Macro
    By ckattookaran in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2012, 11:50 AM
  7. [SOLVED] Sorting Parent Child
    By kcmtnbiker in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-30-2006, 09:00 PM

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