Forum Discussion
Sort custom Month Year column
Hi all,
I have one month-year column e.g January 2021 that drive from seperate month and year column. That 2 column drive from one datetime column from another table.
I'm intended to use the month-year column for line chart as x-axis. How can I sort those month-year column properly on the visual.
Thank you in advance for the help
- Anonymous4 years ago
What I do is convert month and year to number e.g January 2021 to 202101 and sort the month-year column using the number column.
"sort by column" definitely help!!
thanks mahoneypat
2 Replies
- mahoneypatMicrosoft Employee
You can either create a column with Date.ToText([Date], "yyyyMM") and use it as a Sort By column for the one in your visual. Or use a Date table that does not require a Sort By Column.
No Sort Date Tables! – Hoosier BI
Pat
- AnonymousNot applicable
What I do is convert month and year to number e.g January 2021 to 202101 and sort the month-year column using the number column.
"sort by column" definitely help!!
thanks mahoneypat