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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
k_rahul_g
Frequent Visitor

Adding a summary column for parent at multlevel Hierarchy

Hi, I have a power BI table  (BaseData) with columns as 

WorkItemID, WorkItem Type,  ParentID, Path (created using Path Function) , Effort Esitmate, Effort Spent. 

 

for Simplicity, I have added another table (Parent_Child) that has just 2 columns - Parent ID and Child ID ( both referrring to workitems in parent table)

 

I want to add a column at workitem level, that goes recursively in the hierarchy and adds effort values for all child workitems. 

 

I know it can be done using "PathContains" function, but due to large size of the dataset, powerBI just hangs before the calculation is completed. 

 

sample Data 

workItemIDParentIDworkItemTypeTask CategoryPathCategory_Path_Total Estimate_Total Effort
10208532963Task 3465|32963|102085Program Epic | Story | Task |  |  |  |  |  | 1616
10208732963Task 3465|32963|102087Program Epic | Story | Task |  |  |  |  |  | 3232
10233732963Task 3465|32963|102337Program Epic | Story | Task |  |  |  |  |  | 3232
10234032963Task 3465|32963|102340Program Epic | Story | Task |  |  |  |  |  | 88
10285932963Task 3465|32963|102859Program Epic | Story | Task |  |  |  |  |  | 88
10286632963Task 3465|32963|102866Program Epic | Story | Task |  |  |  |  |  | 2424
10286732963Task 3465|32963|102867Program Epic | Story | Task |  |  |  |  |  | 1616
10286832963Task 3465|32963|102868Program Epic | Story | Task |  |  |  |  |  | 2424
10287032963Task 3465|32963|102870Program Epic | Story | Task |  |  |  |  |  | 2424
10400932963Task 3465|32963|104009Program Epic | Story | Task |  |  |  |  |  | 16
10401032963Task 3465|32963|104010Program Epic | Story | Task |  |  |  |  |  | 1616
10401532963Task 3465|32963|104015Program Epic | Story | Task |  |  |  |  |  | 2424
10401632963Task 3465|32963|104016Program Epic | Story | Task |  |  |  |  |  | 2424
10401832963Task 3465|32963|104018Program Epic | Story | Task |  |  |  |  |  | 3232
10582532963Task 3465|32963|105825Program Epic | Story | Task |  |  |  |  |  | 2424
10582632963Task 3465|32963|105826Program Epic | Story | Task |  |  |  |  |  | 3232
10582832963Task 3465|32963|105828Program Epic | Story | Task |  |  |  |  |  | 2424
10582932963Task 3465|32963|105829Program Epic | Story | Task |  |  |  |  |  | 2424
10710732963Task 3465|32963|107107Program Epic | Story | Task |  |  |  |  |  | 2424
11174132963Task 3465|32963|111741Program Epic | Story | Task |  |  |  |  |  | 2424

 

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @k_rahul_g - Ensure that your BaseData table and the Parent_Child table have the necessary relationship based on the WorkItemID and ParentID. This will help DAX understand the hierarchy.
Recursive Summation Using a Measure the Effort Esitmate across all child work items:

 

Total Effort Recursive =
VAR CurrentWorkItem = MAX(BaseData[WorkItemID])
VAR ChildEfforts =
CALCULATE (
SUMX (
FILTER (
BaseData,
BaseData[ParentID] = CurrentWorkItem
),
[Effort Estimate]
)
)
VAR RecursiveChildEfforts =
CALCULATE (
SUMX (
FILTER (
Parent_Child,
Parent_Child[Parent ID] = CurrentWorkItem
),
[Total Effort Recursive]
)
)
RETURN [Effort Estimate] + ChildEfforts + RecursiveChildEfforts





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
rajendraongole1
Super User
Super User

Hi @k_rahul_g - Ensure that your BaseData table and the Parent_Child table have the necessary relationship based on the WorkItemID and ParentID. This will help DAX understand the hierarchy.
Recursive Summation Using a Measure the Effort Esitmate across all child work items:

 

Total Effort Recursive =
VAR CurrentWorkItem = MAX(BaseData[WorkItemID])
VAR ChildEfforts =
CALCULATE (
SUMX (
FILTER (
BaseData,
BaseData[ParentID] = CurrentWorkItem
),
[Effort Estimate]
)
)
VAR RecursiveChildEfforts =
CALCULATE (
SUMX (
FILTER (
Parent_Child,
Parent_Child[Parent ID] = CurrentWorkItem
),
[Total Effort Recursive]
)
)
RETURN [Effort Estimate] + ChildEfforts + RecursiveChildEfforts





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.