Forum Discussion
Scatter plot- add legend removes the X axis ordering
Hi, valcat27 ;
According to your data,because your data have same ClientID but different ProductID, so it can’t identify by which ProductID the same ClientID(such as two f) should be sorted?
My idea is create a ClientID2 column which make the two f change to "f" and "f " respectively, and add a space to distinguish the different keys. In you simple example.I create a column as follows:
ClientID2 = var _count=CALCULATE(COUNT([ClientID]),ALLEXCEPT('Table','Table'[ClientID]))
return IF(_count=1,[ClientID],IF([ProductID]=CALCULATE(MIN([ProductID]),ALLEXCEPT('Table','Table'[ClientID])),[ClientID],[ClientID]&" "))
The final output is shown below:
Of course, if you have three or more same ClientID but different ProductID, you only add more space to distinguish it.
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello v-yalanwu-msft ,
Thank you for your effort and I am sorry for my delay but I could not properly analyse your answer before.
From what I understood, as I can have thousands of ProductID's for the same ClientID's, I would have to adapt your formula and probably create some variable counter (I do not know...). Nevertheless, I think that adding the legend will not be effective because I will have so many colours for the same ClientID that it will be hard to analyse the visual.