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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
rehtdats
Regular Visitor

Filter Parent based on child selection

Hello,

 

I have an interesting problem I'm trying to set up a visual for and I can't quite get the filter set up correctly. We have a data structure that looks like this:

Untitled1.png

 

I want to be able to select any of the child values via a filter but filter the parents that contain that child. So, for example, if I select Child "A" it would apply a filter like this:

Untitled2.png

 

From that I want to create a visual that would look something like this:

Untitled3.png

 

Any help would be greatly appreciated, thanks!

2 REPLIES 2
ValtteriN
Super User
Super User

Hi,

Here is one way to do this:

Data:

ValtteriN_2-1663348532630.png

 



Dax:

Parent Filter Measure =
var _child = MAX('Table'[Child]) return
IF(COUNTROWS(FILTER('Table','Table'[Child]=_child))>0,1,0)

Apply the filter measure like this:

ValtteriN_0-1663348487072.pngValtteriN_1-1663348503654.png

For the result table you can utilize similar logic for example:

Count child =
var _child = MAX('Table'[Child]) return

COUNTROWS(FILTER(ALL('Table'),'Table'[Child]=_child))

ValtteriN_3-1663348794362.png

 

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks @ValtteriN,

 

I have sucessfully been able to get the child counts a number of different ways, but I'm still struggling to get that overall parent count along with the "rate" is ultimately what I'm trying to get. No matter how I slice it the parent counts keep aligning with the child counts and all the rates are 100%.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors