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
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


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.

Top Solution Authors