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
ogend
Helper II
Helper II

Flattened Multi Level Hierarchy to only show the last item in the path

Hi Power BI Gurus, 

 

I have a multi level hierarchy table:

ChildIDChildNameParentIDParentName
aAAA  
bBBBaAAA
cCCCaAAA
dDDDcCCC
eEEEdDDD
fFFFd

DDD

I can create a flat view  with  calculated columns:

 

path = path('Table'[ChildID ],'Table'[Parent ID ] )

Level1 = LOOKUPVALUE('Table'[ChildName ],'Table'[ChildID ],PATHITEM('Path'[path],1,INTEGER))

Level2 = LOOKUPVALUE('Table'[ChildName ],'Table'[ChildID ],PATHITEM('Path'[path],2,INTEGER))
Level3...

 

ChildIDLevel1Level2Level3Level4
aAAA   
bAAABBB  
cAAACCC  
dAAACCCDDD 
eAAAEEEDDDEEE
fAAAFFFDDDFFF

 

I would like to get to this view where the Level value only shows if it corresponds to the last ( or only) item in the path. 

ChildIDLevel1Level2Level3Level4
aAAA   
b BBB  
c CCC  
d  DDD 
e   EEE
f   FFF

 

Is this possilbe? 

Thank you

1 ACCEPTED SOLUTION
ALLUREAN
Solution Sage
Solution Sage

Hi, @ogend 

You can try something like:

https://www.dropbox.com/s/tdxmio6vj9fg7m8/Flattened%20Multi%20Level%20Hierarchy%20to%20only%20show%2...

 

Did I answer your question? Please Like and Mark my post as a solution if it solves your issue. Thanks.

Appreciate your Kudos !!!

https://allure-analytics.com/

https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA

https://www.linkedin.com/company/77757292/




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


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @ogend ,

 

Does the replies above solve your problem? If it has been solved, please mark the correct reply as the standard answer to help the other members find it more quickly.Thanks in advance for your kind cooperation!

 

Hope it helps,


Community Support Team _ Caitlyn

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

ALLUREAN
Solution Sage
Solution Sage

Hi, @ogend 

You can try something like:

https://www.dropbox.com/s/tdxmio6vj9fg7m8/Flattened%20Multi%20Level%20Hierarchy%20to%20only%20show%2...

 

Did I answer your question? Please Like and Mark my post as a solution if it solves your issue. Thanks.

Appreciate your Kudos !!!

https://allure-analytics.com/

https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA

https://www.linkedin.com/company/77757292/




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


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




lbendlin
Super User
Super User

Query PATHLENGTH() and then fetch the last item.

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.