Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Charts with N:N relationship entities

(0) ShareShare
ReportReport
Posted on by 20

Hi everyone,

We have around 40 different services and each contact can be linked to any number of those and vice versa (related entity).

What I want to do is create a chart where I see service names on the x axis and number of individual contacts linked to those services on the y axis. 

This is certainly not complicated but I just cannot get round to this.

Any ideas would be much appreciated.

Thanks!

  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    RE: Charts with N:N relationship entities

    Hi jrymkiewicz,

    You can refer to the following link:

    https://crmchartguy.wordpress.com/2014/11/05/nn-relationship-charts-in-ms-dynamics-crm/  

    I can achieve it successfully:

    1.Create one chart:

    pastedimage1666851256151v1.png

    2. Export and Edit chart xml(Red is the modified part):

    Original:

    <datadefinition>
      <fetchcollection>
        <fetch mapping="logical" aggregate="true">
          <entity name="new_services">
            <attribute name="new_name" groupby="true" alias="_CRMAutoGen_groupby_column_Num_0" />
            <attribute name="new_name" aggregate="count" alias="_CRMAutoGen_aggregate_column_Num_0" />
          </entity>
        </fetch>
      </fetchcollection>
      <categorycollection>
        <category alias="_CRMAutoGen_groupby_column_Num_0">
          <measurecollection>
            <measure alias="_CRMAutoGen_aggregate_column_Num_0" />
          </measurecollection>
        </category>
      </categorycollection>
    </datadefinition>

    Edit:

    <datadefinition>
    <fetchcollection>
    <fetch mapping="logical" aggregate="true">
    <entity name="new_services">
    <link-entity name="new_new_services_contact" from="new_servicesid" to="new_servicesid">
    <attribute alias="CountOfContacts" name="new_servicesid" aggregate="count" />
    </link-entity>
    <attribute groupby="true" alias="GroupBy" name="new_servicesid" />
    </entity>
    </fetch>
    </fetchcollection>
      <categorycollection>
        <category alias="GroupBy">
          <measurecollection>
            <measure alias="CountOfContacts" />
          </measurecollection>
        </category>
      </categorycollection>
    </datadefinition>

    3.Import it.

    4.Result:

    pastedimage1666851638555v2.png

    ===========================

    If you don't want to export and import, you can use 'AdvancedChartEditor' xrmtoolbox to edit chart directly.

    pastedimage1666852038308v3.png

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,468 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,287 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans