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
alexsvi
Regular Visitor

Calculated column to find first parent

Hi,

 

Lets say I have this :

IDParentIDNameFirts parent Name
10Name1Name1
20Name2Name2
31Name3Name1
41Name4Name1
52Name5Name2
63Name6Name1
75Name7Name2

 

How do I achive the last column as a calculated column?

 

Thanks!

2 REPLIES 2
amitchandak
Super User
Super User

@alexsvi , Try a new column like

coalesce(maxx(filter(table, [ID] =earlier([parent_id])),[name]),[Name])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I actually need to "go up" until I have a 0 in parent_id. I can have more than 5-6 layers in reality.

I tried your code and it almost work, but some doesnt "climb" to the top parent

 

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