Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
So I have something like this :
ID | ParentID | Name | Level |
1 | Name1 | 1 | |
2 | 1 | Name2 | 2 |
3 | 2 | Name3 | 3 |
4 | 3 | Name4 | 4 |
5 | 2 | Name5 | 3 |
6 | 4 | Name6 | 5 |
7 | 23 | Name7 | 3 |
What I want to accompish is to have the first parent name on every column.
The thing is that the parentID can be inexistant.
So in my example every FirstParentName would be Name1 except for ID 7. (i dont care what the FirstParentName would be for ID 7. I just dont want PowerBI to give me errors).
Any idea how to create this new column?
Thanks a lot!
Solved! Go to Solution.
This requires the PATH function, but requires that all parents also exist in the ID column. To avoid this, you must first create another column to fix it.
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
This requires the PATH function, but requires that all parents also exist in the ID column. To avoid this, you must first create another column to fix it.
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@alexsvi -
Are you attempting to use PATH ( ) simliar to https://www.daxpatterns.com/parent-child-hierarchies/# and you're receiving '23 does not exist'?
Does using the below satisfy your need?
EntityPath =
IFERROR (
LOOKUPVALUE ( 'Table'[Name], 'Table'[ID], 'Table'[ParentID] ),
BLANK ()
)
Proud to be a Super User!