When creating charts for Dynamics 365, the Advanced Chart Editor in the XrmToolBox can handle most of the presentation and formatting of the chart. The work with the data happens in the fetch part of the chart XML, which still needs to be edited manually. Especially if you create charts that utilize relationships and N:N many to many relationships.
For those situations, you can use the FetchXML Builder in the XrmToolBox to help modify the fetch. Aside from helping with the syntax, relationship names, property names, and basically writing the FetchXML for you, it can also show you data retrieved in a table format. That can be very helpful in troubleshooting the fetch part of your chart as you can see exactly how the data is retrieved.
The video below demonstrates how I use the FetchXML Builder to help create a chart on a N:N relationship from the User entity to the Security Role entity.
I’d recommend watching the video on full screen on YouTube as some of the property texts and drop-down boxes can be a little small.
Update: As Jonas from the FetchXML Builder accurately points out in the comments, there’s no need to do the second link-entity to get on the Security Role entity, just to do a count. I usually add this step as it then allows me to group and order by properties on the related entity as well. The step is also required if we were doing a sum on a money field rather than a count. You also need it if you want to filter the records on the second entity. For example, if we only wanted to count security roles with a particular name. I missed pointing that out in the video.
Hope you found it useful. As always, please sign up for my newsletter and follow me on Twitter Follow @CRMChartGuy