Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
OneWithQuestion
Post Prodigy
Post Prodigy

Filter Child back to Parent(s) without using bidirectional?

What is the "easiest" way to enable filtering on the child record so that selecting a child record will filter the parent(s)?

In this scenario, not all parent records have children.  

I have a mockup with Customer and Payment Method, I'd like to be able to click on a child Payment Method and see all the Customers (parents) who used that payment method.



OneWithQuestion_0-1640211291296.png



OneWithQuestion_1-1640211424081.png


I can filter parent to child of course (selecting Jane shows Cash, Credit, Debit)

OneWithQuestion_2-1640211457820.png

 

 

But, what about selecting "Credit" so I can see everyone who used that?

OneWithQuestion_3-1640211485560.png



I could add a count of Payment Methods to the Customer data grid, but I have to instruct it to show items with no data or it will hide all the parents without children.  If I show items without data it won't filter either, it will just show counts.


OneWithQuestion_4-1640211622881.png



*Granted, in the real world you should not have customers who have no payment method, this is just a mockup example.  

2 ACCEPTED SOLUTIONS

Just realised your need to show parents without children. Will see if I can modify.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

Think this works:

 

PaymentMethodFilter = 
IF (ISFILTERED ( PaymentMethod ),
    INT ( NOT ( ISEMPTY ( PaymentMethod ) ) ),
    1
)

 

bcdobbs_0-1640212808595.png

 

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

3 REPLIES 3
bcdobbs
Super User
Super User

If you create a measure like

ParentFilter = INT ( NOT ( ISEMPTY ( 'Customer Payment Methods' ) ) )

and put it on the visual level filter of a parent visual (or slicer) with it set to "Is 1" you should get the desired interaction.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Just realised your need to show parents without children. Will see if I can modify.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Think this works:

 

PaymentMethodFilter = 
IF (ISFILTERED ( PaymentMethod ),
    INT ( NOT ( ISEMPTY ( PaymentMethod ) ) ),
    1
)

 

bcdobbs_0-1640212808595.png

 

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.