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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Aggregate based on parent child elements

Hi,

I have a following table and its expected result. Some of my elements have child elements. I would like to calculate a sum of Time for parent and all its children.

 

Untitled.jpg

 

Thanks for your help

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

I would suggest making sure you have a Parent ID for all rows. If the ID field doesn't have a parent ID, populate the ParentID with ID field when loading your data. This way you can just sum based on the Parent ID.

View solution in original post

fhill
Resident Rockstar
Resident Rockstar

Just throw in a Calculated Column with your selection logic, then used your Calculated Column for the sumazation... 

Cal_Column = If(ISBLANK(Table1[ParentID]),Table1[ID],Table1[ParentID])

 

Capture.PNG




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




View solution in original post

2 REPLIES 2
fhill
Resident Rockstar
Resident Rockstar

Just throw in a Calculated Column with your selection logic, then used your Calculated Column for the sumazation... 

Cal_Column = If(ISBLANK(Table1[ParentID]),Table1[ID],Table1[ParentID])

 

Capture.PNG




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




Anonymous
Not applicable

I would suggest making sure you have a Parent ID for all rows. If the ID field doesn't have a parent ID, populate the ParentID with ID field when loading your data. This way you can just sum based on the Parent ID.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors