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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
AGo
Post Patron
Post Patron

List eventual child ID knowing parent ID in a hierarchy

Hello,

I've got a parent-child table with calculated levels (in this case max depth is 4), eg. my first 34 rows, it's written in numbers but the type is text.

ParentIDDepthLevel 1Level 2Level 3Level 4
1111111000
11122111200
11132111300
11142111400
11152111500
121631112160
121731112170
121831112180
121931112190
1620411121620
2121121000
21222212200
21232212300
21242212400
21252212500
222632122260
222732122270
222832122280
222932122290
2630421222630
3131131000
2252304217218225230
2252314217218225231
2252324217218225232
236237223623700
236238223623800
236239223623900
236240223624000
236241223624100
23724232362372420
23724332362372430
23724432362372440
23724532362372450
2422464236237242246

 

I would like to create a calculated column that returns the child (grandchildren also and so on) ID list with concatenation, for each ID, of course only if the have descendants (if not it's blank).

I would then use this function in another measure like this CALCULATE(SUM(value);[id] in {PreviousCalculatedFunction}) in a table viz next to ID field.

 

Is it possible?

Thanks!

1 REPLY 1
Greg_Deckler
Super User
Super User

Sounds like you want PATH

https://docs.microsoft.com/en-us/dax/path-function-dax



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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