Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
k_rahul_g
Frequent Visitor

Multi level parent child hierarchy summarization

I have a Power BI tabel (Attached) which as workitem, workitem type, Effort (Parent),  Child (of the workitem).  

This table also have multiple level of hierarchy i.e.  a Child would be replicated as a workitem if it has further children and may go on to multiple levels. ( I counted it to go to some times 8 levels). 

 

The workitem ID (entire row) replicates as many children it has. ( I know it is not the best database table but that is how it has been structured and i dont have the option to change it.)

 

My problem statement is to summarize the data at the parent level. i.e. if the parent is Defect, then all its children and  grandchildren.. or great grand children's effort is to be summarized at this parent level.  The summarization could be at any level i.e. if defect has story and story has a task child item. I may be required to summarize at story level. 

 

 

 

workItemIDworkItemTypechildIDestimate
25002Business Need2502022.99139
25002Business Need2502122.99139
25002Business Need2799922.99139
25002Business Need2863222.99139
25021Defect14252
1400Defect 10
1425Task779924
1425Defect782524
1425Defect782624
1425Defect989324
1426Defect609212
1426Defect609612
1426Defect609912
1429Defect 2
1695Defect 1
1730Defect 2
1882Defect19055
2411Defect 8
2412Defect 8
2413Defect 12
2414Defect 8
2415Defect 10
2416Defect 20
2417Defect 15
2418Defect 30
2419Defect 10
6 REPLIES 6
ImkeF
Super User
Super User

Hi @k_rahul_g ,
if you need your table unmodified, you can use this approach: 
Parent-Child Hierarchies with multiple parents in Power BI with Power Query (thebiccountant.com)
It works with multiple parents as well.
Please check file enclosed.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Syndicate_Admin
Administrator
Administrator

 I tried using th path function and it gives erros that  every workitem (i.e. Parent) should also appear as the child in the table.  

If you examine my Power Query code you will see that this is taken care of.

Syndicate_Admin
Administrator
Administrator

A child cannot have two parents in a hierarchy  (as opposed to IRL) so ignoring the parent entries for 23156 and 13329. Next we need to fill the gaps for childless parents.  Then you can use the PATH functions for your rollups.

 

I'll leave the next step to you.

Your solution, I believe is eliminating some data, which is something I would like to avoid. 

 

The table would always have a childless parents. As there would  be node levels. This can not be eliminated. I tried using th path function and it gives erros that  every workitem (i.e. Parent) should also appear as the child in the table.   

My data would not have this established as there would be workitems that are in analysis and have not been divided into further tasks or stories.  

Hence looking for another work arond. 

 

and while giving sample data i  made that mistake of multiple parents to a child. This is not the scenario in actual data. A child would have 1 parent only.  but a parent would have multiple levels of children. 

Syndicate_Admin
Administrator
Administrator

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors