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

Announcements

No record found.

News and Announcements icon
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!

I have the same question (0)
  • Suggested answer
    Leah Ju Profile Picture
    Microsoft Employee on at

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 174

#2
ManoVerse Profile Picture

ManoVerse 58 Super User 2026 Season 1

#3
Niki Patel Profile Picture

Niki Patel 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans