Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Sort Order by Size in Bar Chart

Posted on by 275

Hi Community,

Is it possible to sort by size in a Bar Chart?

In the screenshot below, I have the countries on X Axis and the numbers on the Y Axis.

The countries are showing from left to right in alphabetical order.

I would like however for the countries to show from left to right in size (from highest to lowest)

bar-chart-issue.PNG

Thanks,

Debbie

  • LuHao Profile Picture
    LuHao 40,872 on at
    RE: Sort Order by Size in Bar Chart

    Hi Debster25,

    Has your problem been solved? Any other questions?

    Thanks.  :)

    Hope this helps.

    Best Regards,

    Lu Hao

  • Suggested answer
    LuHao Profile Picture
    LuHao 40,872 on at
    RE: Sort Order by Size in Bar Chart

    Hi Debster25,

    We need to export this chart, modify XML file and import it.

    The key XML strings we need to use is: <order alias="..." descending="true" />

    The following is the step process:

    1. As shown, this is a bar chart. The horizontal axis is the name of the Owner, and the vertical axis is the number of Account.

    8284.4.JPG

    Click on "···" in the top right corner and then click on the Export Chart button. 

    1732.2.JPG

    2. Open the download XML file, then find this part: <entity name="...">...</entity>. In my XML file, it is this:

    ......
    <fetch aggregate="true" mapping="logical">
      <entity name="opportunity">
        <attribute name="ownerid" alias="_CRMAutoGen_groupby_column_Num_0" groupby="true" />
        <attribute name="parentaccountid" aggregate="count" alias="_CRMAutoGen_aggregate_column_Num_0" />
      </entity>
    </fetch>
    ......

    Then we want to have this chart sorted by the vertical axis. We need to add a line of XML strings above </entity>.

    It is <order alias="_CRMAutoGen_aggregate_column_Num_0" descending="true" />

    In the double quotes is the alias of the vertical axis. Fill in the alias according to your chart.

    Therefore, the downloaded XML file should be modified to:

    ......
    <fetch aggregate="true" mapping="logical">
      <entity name="opportunity">
        <attribute name="ownerid" alias="_CRMAutoGen_groupby_column_Num_0" groupby="true" />
        <attribute name="parentaccountid" aggregate="count" alias="_CRMAutoGen_aggregate_column_Num_0" />
        <order alias="_CRMAutoGen_aggregate_column_Num_0" descending="true" />
      </entity>
    </fetch>
    ......

    3. Import the modified XML file into D365. It is sorted by the vertical axis.

    1732.3.JPG    8284.4.JPG

    Please refer to this article for importing and exporting charts: 

    [View:https://crmbook.powerobjects.com/basics/analytics/charts-4/:320:50]

    If my answer is helpful, please mark it as verified. This will help other users with the same theme.

    Hope this helps.

    Best Regards,

    Lu Hao

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans