X-axis sort order breaks when adding legend in scatter chart
Hi v-qiuyu-msft,
Thanks for your response, and sorry for the slow reply.
I figured out the cause of the issue: when you add a legend to the scatter chart, the field in the legend has an affect on the scatter points whereby it seems like each value in the legend field is ordered separately, in addition to the order specified by the field on the x-axis.
I realise that this isn't easy to explain in writing, so here's a pbix file to show what's happening. The x-axis has the field "Level" which is either "Low", "Medium" or "High". The y-axis has a dummy aggregator for a field "Target Level", which is used to plot the "Level" against the "Target Level". The correct order for the x-axis is "Low", "Medium", "High", which has defined in the data model.
Before adding the legend, the sort order works - it is always in the order "Low", "Medium", "High". However, when adding a "Group" field to the legend, the sort order goes to "Low", "High", "Medium".
Single selecting a "Group" on the filter pane fixes things, but when no "Group" (or all Groups) is selected, the sort order goes awry.
I think it's something to do with the fact that there isn't data in the fact table for all combinations of the legend field and the x-axis field (imagine you were to do a cross-join between those fields). This leads to the apparent behaviour where the x-axis sorts differently depending on the combination of legend values selected.
Is this expected behaviour?
Hope this helps,
Ed