Forum Discussion
Sorting azure map legend entries by column not working
Hi everyone,
I have an issue with the azure map visual regarding the sorting of the legend entries. What I want to do, is sort these entries in the map legend by a fixed order that makes sense (cheapest to most expensive):
Now, I have read many posts already that seem to have just the right solution to this, which is to sort by another column in the data model. I have managed to do so, but there is no effect of this in the azure map legend entry sorting. I checked with the other map visual (the simple, old one) and with other non-map visuals and it does work for these (see picture below), but like I said, not in the azure map visual.
I could theoretically switch to the old map visual, but I do want some of the new features of the azure map, so I would like to know if there is something, I am doing wrong or could do differently. Is this a known issue or on purpose with azure maps?
Thanks for reading.
3 Replies
- AnonymousNot applicable
Hi Rob35 ,
1. create a new table, write all the categories and write the sort you expect using numbers.
2. select the category column and have it sorted by the num column.
3. create a relationship for the two tables.4. change the fields in the visual object.
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Rob35Frequent Visitor
Hi Clara, thanks for helping me out. I have tried that already and it does not work as in your example. The reason is, that I have another measure as a size measure in the visual. Apparently it is sorted by the sum of the size measure and only when I remove the size measure, does it create the wanted order.
Is there a way to have a size measure and still sort the legend by the legend measure?
Here are two screenshots to show, what I mean:
Kind regards,
Rob
- mike_honey
Memorable Member
For the Azure Map visual, I'm observing the same bug that Rob35 posted about - Legend sort is driven by the Size field values; it reverts to the regular Sort by column order when the Size field is emptied.
Other Built-in Power BI visuals eg Bar Chart offer control over Legend sorting by the "..." menu at the top-right corner of each visual's frame. But they only offer to sort asc or desc by the Sort by column.
Sorting any visual's Legend by values is rather odd - can't think when I would want that. The Legend should not attempt to convey information about the values, and dynamically re-sort when slicers etc are used. That will confuse users. I'll raise a support case.