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 :
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

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 > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 41 Most Valuable Professional

#2
iampranjal Profile Picture

iampranjal 39

#3
Satyam Prakash Profile Picture

Satyam Prakash 35

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans