web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

How to calculate sum of values in N:N relationship

(0) ShareShare
ReportReport
Posted on by 10

Hi.

I have two entities, which relate by N:N relationship. Construction entity and Material entity. Material entity has field materialValue, and Construction entity has field constructionValue which is result of sum all related materialValue. I can not use rollup field for N:N relationship. May be anybody can help me and explain how I can do this? Please forgive me if I wrote too chaotically, but this is my first experience. 

I have the same question (0)
  • Verified answer
    Johnny Gong Profile Picture
    6,482 Moderator on at

    Hi Svetlanasyo,

    It's a little complicated since rollup field doesn't support N:N relationship. So you need to create a manual many-to-many relationship.

    Following article describes one example. When you create two 1:N relationships from the same entity in this manner, this can be described as a manual N:N relationship.

    And you could use the Intermediate transitional entity rollup fields to sum the materialValue field.

    community.dynamics.com/.../microsoft-dynamics-365-manual-n-n-relationship

    Hope above would help.

    Regards

    Johnny

  • Verified answer
    Javier Tafur Profile Picture
    60 on at

    This solution require a Workflow Activity, using a fetch with the agreggate sum.


    Check this links, if not are familiarize with this actions.

    Workflow Example https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/workflow/sample-create-custom-workflow-activity

    About the Fetch https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/use-fetchxml-aggregation

    Programming a workflow activity , you can get sum the materialValue after with a Update Record Step on a normal workflow to set the value on constructionValue.

  • Svetlanasyo Profile Picture
    10 on at

    Thank you very much :-)

  • Javier Tafur Profile Picture
    60 on at

    Hi, Svetlanasyo remember close this thread if the response was usefull  : )

    Best Regards.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 98

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 60 Super User 2025 Season 2

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans