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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
janisska
Regular Visitor

Search in a tree hierarchy visual

Dear community,

 

I'm really stuck and could really use some advice. I have a source table with already existing multilayer parent-child hierarchy.

I have tried different visuals, but for example the decomposition tree doesn't work for my needs and the easiest and best one seems to be the Tree by ck corporation, because it already works with the parent-child hierarchy and no separating columns was necessary (although I have tried but the issue with the search was still there, just a different one).

 

I have a big amount of data, so I would really need a typing search slicer.


The visual looks great, but I need to be able to search as there is just too much values, but I can't figure out how to do it, because when I use a slicer to filter a name, the hierarchy dissapears and there is only the one value, but I would like to see the whole structure concerning that particular name (meaning all parents and all children).

I have tried different DAX approaches but nothing has worked for me.

 

I will be grateful for any advice. Thanks in advance!

4 REPLIES 4
Sahir_Maharaj
Super User
Super User

Hello @janisska,

 

Can you please try the following:

 

1. Create a calculated column for the Path

PathColumn = PATH(Table[NodeID], Table[ParentID])

2. Create Measure for Node Search

SelectedNodeSearch = 
VAR SelectedNode = SELECTEDVALUE('NodeTable'[NodeName])
RETURN
IF(
    CONTAINSSTRING(Table[PathColumn], SelectedNode),
    1,
    0
)

3. Create Measure for Showing Parent and Child Nodes

ShowRelatedNodes = 
IF(
    [SelectedNodeSearch] = 1,
    1,
    0
)

In your Tree visual, add the ShowRelatedNodes measure as a visual-level filter and set it to show only when the value equals 1 (ensures that when a node is selected, the entire hierarchy structure (including parents and children) remains visible.)

 

Hope this helps.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ About: https://sahirmaharaj.com/about.html
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Hi @Sahir_Maharaj, thanks for your reply. I have already tried this with chat gpt (as well as many other solutions), here I get an error with the SelectedNodeSearch.

"A single value for column 'PathColumn' in table 'Table' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."

suparnababu8
Super User
Super User

Hi @janisska 

You may use Hirearchy slicer for your need. 

suparnababu8_0-1725970249247.png

If you need additional information pls go through this https://data-mozart.com/finding-the-right-path-understanding-parent-child-hierarchies-in-power-bi/   

Hi @suparnababu8, thanks for your reply. I tried it and this slicer works nice with the decomposition tree, however for the parent-child hierarchy in my Tree from ck corporation it doesn't.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors