Forum Discussion
Why is the order wrong?
Hi Power BI Community
I have this measure
but this is the result:
I tried to sort It in the right chronical order but there is no why.
Must I add an ID to sort it?
Thank you for your time
- Anonymous5 years ago
mahoneypat Thank you for your reply.
I did that and the order works but now it does show 0-2 and 2-5 as blank.
3 Replies
- mahoneypat
Microsoft Employee
You will need to add a sort by column. You can use your same expression but return 1,2,3,4,5,6 instead of "0-2 Days", etc.
Regards,
Pat
- AnonymousNot applicable
mahoneypat Thank you for your reply.
I did that and the order works but now it does show 0-2 and 2-5 as blank.
- mahoneypat
Microsoft Employee
That's odd. Please confirm the two terms in your DATEDIFF in your SWITCH is referencing two columns in that same table. If either are measures, you would also need to consider the sort by column in any filter changes on your original switch column. This approach should work, but another approach would be to make a disconnected table with your axis values (0-2 Days, etc.) and upper/lower limits.
If that doesn't help, you can share link to the pbix (or a mock version of it) and I can get it working.
Regards,
Pat