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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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