Forum Discussion
Power Query - flatten Parent-child hierarchy
- 3 years ago
I've solved it with a help of LivioLanzo solution to this post.
https://community.powerbi.com/t5/Desktop/Parent-Child-Hierarchy-Highest-Parent-using-Power-Query-not-DAX/td-p/519919It's dynamic, not fixed solution.
You are not just flattening the hierarchy - you are also forcibly converting it from ragged to fixed depth. Doing that with repetitions of values is generally frowned upon. While the function you mentioned could be modified that would include a second run to identify the maximum level of depth before you would then traverse the hierarchy. I don't think it is a good idea. What's the next step?
Note that Power Query producing variable output is asking for trouble. Your downstream processes (Power BI Meta data) will break.
I've solved it with a help of LivioLanzo solution to this post.
https://community.powerbi.com/t5/Desktop/Parent-Child-Hierarchy-Highest-Parent-using-Power-Query-not-DAX/td-p/519919
It's dynamic, not fixed solution.
- JonSch_bi1 year agoNew Member
Hi iBusinessBI , I'm looking for exactly this. Would you be so kind to share your PowerQuery / M-Code?
- iBusinessBI1 year ago
Kudo Collector
Here you can find the code:
https://community.fabric.microsoft.com/t5/Desktop/Parent-Child-Hierarchy-Highest-Parent-using-Power-Query-not-DAX/td-p/519919