Forum Discussion
Scatter plot- add legend removes the X axis ordering
Hello v-yalanwu-msft ,
Thank you again for your help.
Creating the index column, I got the same message error. I am sorry, but I noticed that I misinterpreted it. The problem is that the same ClientID can have more than one product. So when I choose to sort ClientID column by sort/index column, that client will have more than one value associated and probably the program will not know which value to choose to apply the sorting.
Hi, valcat27 ;
Sorry, it is difficult to reproduce your mistake, can you share your file whitout any sensitive information?
- valcat275 years ago
Helper III
Hello v-yalanwu-msft ,
The error message is the same. I created a new table (Table2) with duplicated clients in your pbix. I think that if you try to sort ClientID column by sort/index column, you will get the message that I referred.
I'm not able to attach the pbix. I tried to paste it and I got the error: "The file type (.pbix) is not supported."
This is the table with my changes:
ProductID Price ClientID 12244 13 f 12334 53 f 12345 16 ce 12345 17 be 12345 8 ce 13234 12 a 13445 45 sd 13455 21 dw 45566 13 a - v-yalanwu-msft5 years ago
Community Support
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.- valcat275 years ago
Helper III
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.