Forum Discussion
Sort chronologically x axis based on date and time column
- 5 years ago
Hello Anonymous ,
Thank you for your answer.
Comparing with your data, I thought everything was equal, but then I noticed that the problem was related to the legend. In fact, when I excluded it, dates are sorted chronologically.
I think the problem is related to the model structure. The chosen column for the legend is from another table. This table is not connected directly to the table that I'm using for the values on the y and x axis and the relationship between both tables are many to many. Now I'm trying to recreate the model to be possible to include the legend and keep x axis sorted chronologically.
Best regards,
Hi,
Based on your description, I did a test. Unfortunately, I cannot reproduce your issue. Please verify that my steps are as follows. Is there anything I missed?
Best Regards,
Yuna
Hello Anonymous ,
Thank you for your answer.
Comparing with your data, I thought everything was equal, but then I noticed that the problem was related to the legend. In fact, when I excluded it, dates are sorted chronologically.
I think the problem is related to the model structure. The chosen column for the legend is from another table. This table is not connected directly to the table that I'm using for the values on the y and x axis and the relationship between both tables are many to many. Now I'm trying to recreate the model to be possible to include the legend and keep x axis sorted chronologically.
Best regards,
- BenF5 years agoNew Member
Hello,
I encouter the same issue : using a scatter chart with date as X-axis and it is not sorted chroinologically when I use a legend. I think I understood the sorting strategy. Power BI plots the first column type of the legend using the chronological order. If another type of the legend contains data on the same date it is also plotted in the chronological order. If there is no data on a given date of the first type it is skipped. Once first column is read, it follows with next column type,... Better than my explanation, hear is a picture that is probably easier to understand
However, I don't have the solution to solve this issue. The only thing I can think of is to create a fake null value on each date for all types but it doesn't seem to be a robust solution.
Does anyone have an idea on how to solve it.
Thanks in advance for you support.
Best regards,
Benjamin
- BenF5 years agoNew Member
Hello, I found a solution by showing blank values as described in the post
It is quite close to what I had in mind but easier.