Forum Discussion
Find the main value
Hello everyone
I have a table called "Project", the unique key is a 6-digit project number, column name "ProjectNumber". Each project can be part of a larger project, so I have a "ParentProject" column that can be empty when there is no parent object or contain the project number in 6 digits when there is one.
The problem is that a parent project can also have a parent, but the data I receive includes only the first parent.
My goal here is to be able to extract data that shows, for a given project, the full list of child projects, including level 2, 3 or even 4.
I'm a very basic PowerBI user, I was doing fine so far, but here, I'm stuck. I thought the lookupvalue function would do the trick, but I could be doing it wrong.
Besides, ideally, I'd have a loop like "Do.. While" (if that's even possible) to find the highest parent of any project, but you could create additioal column also to find level 1 level 2 and so on.
Last but not least : any book recommendation for me to learn a little more advanced features and about DAX for PowerBI?
Thank you!
2 Replies
- mahoneypatMicrosoft Employee
This sounds like a job for the PATH() function. Please see this blog post on how to use it. The example is for employee/supervisor but it can be applied whenever you have a parent/child column relationship.
https://powerpivotpro.com/2017/12/imagine-people-tables/
If this works for you, please mark it as the solution. Kudos are great too. Please let me know if it doesn't or if any questions.
Regards,
Pat