Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Suggested answer

Rollup column Hierarchy aggregation direction (child to parent vs parent to child)

(2) ShareShare
ReportReport
Posted on by 62
Hi,
 
I'm having some issues with Dataverse's rollup column. When using hierarchy, the aggregation goes from the child to the parent. What would be the solution to have it work the other way around, to aggregate from parent to child?
 
 
Ex: We want to track the cost/unit of items (COGS). Currently, when using rollup with hierarchy (parent column), the costs are added to the parent instead of trickling down to the children.
Number
Item Parent Description Debit Quantity Credit Quantity Cost/unit Cost Rollup Cost/unit (expected) Rollup Cost/unit (current = bad) Date
1 Item 01   Arrival warehouse 01 100 50 (01/10) + 5 (01/13) 10$ 1000$ 10$ 10$ (01/01) -> 11$ (01/10) -> 51$ (01/12) -> 86$ (01/13) -> 88$ (01/22) 2025/01/01
2 Item 01 1 Move warehouse 02 50 10 (01/12) 1$ 50$ 11$ 1$   (01/10) -> 41$ (01/12) -> 76$ (01/13) -> 78$ (01/22) 2025/01/10
3 Item 01 2 Ship to customer 01 10 10 (01/22) 40$ 400$ 51$ 40$ (01/12) -> 42$ (01/22)  2025/01/12
4 Item 01 1 Ship to customer 02 5   35$ 175$ 45$ 35$ (01/13) 2025/01/13
5 Item 01 3 Duty on shipment 10   2$ 20$ 53$ 2 $  (01/22) 2025/01/22
 
 
Ex: We have a table named Format where we store the packaging format we use. What solution could be used to get to total quantity of item in the format (multiplied patent total quantity with child quantity = child total quantity)
Format Name Description Parent Package Quantity Total Quantity Total Quantity (expected) Unit
Format 1.0 Pack of 6 unit   Pack 6   6 unit
Format 1.1 Box of 4, Pack of 6 unit Format 1.0 Box 4   24 (6*4) unit
Format 1.2 Pallet of 8, Box of 4, Pack of 6 unit Format 1.1 Pallet 8   192 (6*4*8) unit
 
Thanks,
Don
Categories:
  • Suggested answer
    Vahid Samimi Profile Picture
    43 on at
    Rollup column Hierarchy aggregation direction (child to parent vs parent to child)
    In my opinion, you have to use a classic workflow for the sync process or create a plugin for that.
    in the Classic workflow approach you can use some prebuilt custom activity library like this one that I implemented
    https://github.com/vahid45/Advance.WorkflowUtility
    or any other library that exist in the GitHub
    in the plugin approach, you need to have some .NET programming knowledge
  • DonLimpio Profile Picture
    62 on at
    Rollup column Hierarchy aggregation direction (child to parent vs parent to child)
    @Vahid Samimi, thank you for the answer :

    1.  Formula columns would be perfect if circular references were enabled : 
      TotalQuantity = IfError('Parent'.TotalQuantity * Quantity, Quantity)

      • Without circular references, it only works for one level of parental depth 

    2. Is Power Automate stable enough and fast enough?

      • In some use cases, the column needs to be updated synchronously

      • In some use cases, this behaviour is needed to save sensitive information in ledgers. Ideally, this would be done on the server side, with rollback in case of error.  
     
    @ronaldwalcott, thank you for the answer :
    TLDR: I'm locking for a solution that will act as formula columns with circular references, in order to have data from parent's being used in child record, for level of child/parent depth greater that one. Ideally this will be done on server side and synchronously.
  • Suggested answer
    Vahid Samimi Profile Picture
    43 on at
    Rollup column Hierarchy aggregation direction (child to parent vs parent to child)

    Since rollup columns naturally aggregate from child to parent, and calculated columns are being phased out, here’s how you can achieve parent-to-child aggregation:

    1. Using Formula Columns (Recommended)

    • Formula Columns allow you to perform calculations dynamically using Power Fx.

    • You can reference the parent record’s value and apply a formula to calculate the child’s total quantity.

    • Example Formula:

      plaintext
      Parent.TotalQuantity * Child.Quantity
      
    • This ensures that the child’s total quantity is derived from the parent.

    2. Using Power Automate

    • If Formula Columns don’t meet your needs, you can use Power Automate to update child records whenever the parent record changes.

    • Steps:

      1. Trigger the flow when a parent record is updated.

      2. Retrieve all child records linked to the parent.

      3. Update each child record with the calculated total quantity.

  • ronaldwalcott Profile Picture
    3,810 on at
    Rollup column Hierarchy aggregation direction (child to parent vs parent to child)
    Rollup is normally from child to parent.
    Can you explain a bit more what you are trying to accomplish here
     
    Ex: We have a table named Format where we store the packaging format we use. What solution could be used to get to total quantity of item in the format (multiplied patent total quantity with child quantity = child total quantity)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics