March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
In a hierarchical table "BaseData" , I have to summarise an attribute "timespent" for all LEVELS of child work item. the problem is that the parent (where it need to be summarize) could also be a child of another workitem ( this is where Pathcontains might fail - dont suggest that please.)
The table is fully flattend table going upto 9 levels.
I have follwoing columns
Workitem
Workitemtype ("Program Epic", SWApproval, Defect, Story, Work and Review, Task)
Path ( this is generated using DAX path function)
Level1
Level2
level 3 ..... Upto level 10. ( each level will be represented as an idependent workitem )
TimeSpent ( this is what i need to summarize)
Some Cases - Program EPIC-> Defect-> Story -> Task
OR
Defect-> Story->Work& Review-> Task
OR
Program Epic -> Program Epic -> Defect -> Story-> Task
OR
Program EPIC-> SWApproval-> Story -> Task
I want only the sum of child ( All levels) for a workitem type "SWApproval" going recursively in the table or using the flattened hierarchy.
The SWApproval could appear at any level and have children (grand children) workitems.
Here is sample data.
workItemID | workItemType | timespent | estimate | Path | PathLength | Level1 | Level2 | Level3 | Level4 | Level5 | Level6 | Level7 | Level8 | Level9 | Level1_category | Level2_category | Level3_category | Level4_category | Level5_category | Level6_category |
72935 | Work and Review | 16 | 16 | 53705|58010|69131|69689|72935 | 5 | 53705 | 58010 | 69131 | 69689 | 72935 | Program Epic | SWApproval | Story | Work and Review | Work and Review | |||||
73180 | Work and Review | 0.5 | 8 | 99418|97842|72103|72104|73180 | 5 | 99418 | 97842 | 72103 | 72104 | 73180 | Program Epic | SWApproval | Program Epic | Story | Work and Review | |||||
73357 | Work and Review | 20 | 20 | 53705|58010|69131|69689|73357 | 5 | 53705 | 58010 | 69131 | 69689 | 73357 | Program Epic | SWApproval | Story | Work and Review | Work and Review | |||||
73460 | Work and Review | 0 | 45 | 95083|21464|32549|32844|73460 | 5 | 95083 | 21464 | 32549 | 32844 | 73460 | Feature | Program Epic | Story | Task | Work and Review | |||||
74293 | Work and Review | 74 | 144 | 53705|58010|69131|69689|74293 | 5 | 53705 | 58010 | 69131 | 69689 | 74293 | Program Epic | SWApproval | Story | Work and Review | Work and Review | |||||
74435 | Work and Review | 40 | 40 | 99418|97842|72127|72128|74435 | 5 | 99418 | 97842 | 72127 | 72128 | 74435 | Program Epic | SWApproval | Program Epic | Story | Work and Review | |||||
74436 | Work and Review | 40 | 40 | 99418|97842|72127|72128|74436 | 5 | 99418 | 97842 | 72127 | 72128 | 74436 | Program Epic | SWApproval | Program Epic | Story | Work and Review | |||||
74437 | Work and Review | 32 | 32 | 99418|97842|72127|72128|74437 | 5 | 99418 | 97842 | 72127 | 72128 | 74437 | Program Epic | SWApproval | Program Epic | Story | Work and Review | |||||
74439 | Task | 16 | 16 | 99418|97842|72127|72128|74436|74439 | 6 | 99418 | 97842 | 72127 | 72128 | 74436 | 74439 | Program Epic | SWApproval | Program Epic | Story | Work and Review | Task | |||
74440 | Task | 8 | 8 | 99418|97842|72127|72128|74436|74440 | 6 | 99418 | 97842 | 72127 | 72128 | 74436 | 74440 | Program Epic | SWApproval | Program Epic | Story | Work and Review | Task | |||
74441 | Task | 32 | 32 | 99418|97842|72127|72128|74436|74441 | 6 | 99418 | 97842 | 72127 | 72128 | 74436 | 74441 | Program Epic | SWApproval | Program Epic | Story | Work and Review | Task | |||
74463 | Work and Review | 40 | 40 | 99418|97842|72091|72092|74463 | 5 | 99418 | 97842 | 72091 | 72092 | 74463 | Program Epic | SWApproval | Program Epic | Story | Work and Review | |||||
74484 | Task | 0 | 40 | 99418|97842|72121|72122|74491|74484 | 6 | 99418 | 97842 | 72121 | 72122 | 74491 | 74484 | Program Epic | SWApproval | Program Epic | Story | Work and Review | Task | |||
74485 | Task | 0 | 16 | 99418|97842|72121|72122|74489|74485 | 6 | 99418 | 97842 | 72121 | 72122 | 74489 | 74485 | Program Epic | SWApproval | Program Epic | Story | Work and Review | Task | |||
74489 | Work and Review | 0 | 40 | 99418|97842|72121|72122|74489 | 5 | 99418 | 97842 | 72121 | 72122 | 74489 | Program Epic | SWApproval | Program Epic | Story | Work and Review |
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
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.
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.
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...
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
34 | |
30 | |
19 | |
19 | |
12 |