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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anil2264
Helper I
Helper I

How to get Lowest Level Hierarchy

Hi Team,

 

I need one help,Hope you can help me out.

I want to get the Lowest Level data to be reflect in my reporting, The lowest level is till 19th Level.

Not able to crack this requirement. I am also providing sample data below.

KeyParent NodePathOutput
1 11
211|22
231|2|33
241|2|3|44
5 55
655|66
755|77
855|88
9 99
1099|1010
11109|10|1111
12 1212
131212|1313

@amitchandak please help it's bit urgent

 

Thanks & regards

Anil

5 REPLIES 5
Anil2264
Helper I
Helper I

Hi @v-easonf-msft 

 

Thanks for you response i would like to go in more deep in heirarchy level. Please refer to the below table and would like to have a lowest level component in front on Material. Can you please help me out how to get it

 

I only need to report extreme lowest level component in my table.

KeyParent NodeMaterialComponent
1 AB 
21ABBC
31ABCD
41ABDE
51ABCD
62BCEF
71ABFG
81ABGH
91ABIJ
109IJKL
111ABLM
121ABMN
131ABNO
141ABPQ
151ABRS
161ABST
171ABUV

Hi, @Anil2264 

Not fully sure what you want. There are obvious differences between the two sample data you provided.

Can you share me the column 'path' in your second sample data?

I think it's difficult to get the result of 'Component' based on column 'Material' due to the lack of data .

Take the third row of records as an example, due to the lack of parent node= key= '3',it is hard to confirm that the lowest component = 'CD'

 

Best Regards,
Community Support Team _ Eason

v-easonf-msft
Community Support
Community Support

Hi, @Anil2264 

You can also try calculated columns as below:

length = PATHLENGTH('Table'[Path])
Last_item = PATHITEM('Table'[Path],'Table'[length])

30.png

Best Regards,
Community Support Team _ Eason

Hi @v-easonf-msft 

 

Thanks for you response i would like to go in more deep in heirarchy level. Please refer to the below table and would like to have a lowest level component in front on Material. Can you please help me out how to get it

 

KeyParent NodeMaterialComponent
1 AB 
21ABBC
31ABCD
41ABDE
51ABCD
62BCEF
71ABFG
81ABGH
91ABIJ
109IJKL
111ABLM
121ABMN
131ABNO
141ABPQ
151ABRS
161ABST
171ABUV
rsbin
Super User
Super User

@Anil2264,

I have a thought...might not be the cleanest, but you said it was urgent.

Start with the RIGHT function. 

Output = RIGHT( [NodePath], 2 )

But since your last characters can be a single digit or two digit, do something with an IF or SWITCH and Containsstring to see if it contains your delimiter "|".  If it does, do Right([NodePath], 1] instead.

You may then need to wrap it in a VALUE statement to convert it back to a number.

Personally, I would need to do it in two or 3 steps, but if you do it correctly, it can be done in one statement.

Hope this at least gives you an idea where to start.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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