Forum Discussion
Sort Chronologically MMM-YY Date
Hello,
I have a month column in MMM-YY format over two years (Month = FORMAT('Actual (2)'[Date].[Date],"mmm-yy") and I have sorted by another column called FiscalMonth (FiscalMonth = (If( Month([Date]) >= 7 , Month([Date]) - 6,Month([Date]) + 6 )), which represents our fiscal calendar. When I create a viz though I get the months from both years in order and not the months from the first year first and then the second year's months.
Any ideas would be appreciated
Your sort column doesn't incorporate the year, so you need to do that. You could consider the approach in this article with custom date strings - https://www.sqlbi.com/articles/creating-a-simpler-and-chart-friendly-date-table-in-power-bi/
Or you can make another FORMAT column with YYYYMM to get the yearmonths in order, and use this new column as your sort column.
Regards,
Pat
3 Replies
- mahoneypatMicrosoft Employee
Your sort column doesn't incorporate the year, so you need to do that. You could consider the approach in this article with custom date strings - https://www.sqlbi.com/articles/creating-a-simpler-and-chart-friendly-date-table-in-power-bi/
Or you can make another FORMAT column with YYYYMM to get the yearmonths in order, and use this new column as your sort column.
Regards,
Pat
- nafta90New Member
Thank you for the help - it worked!
- AnonymousNot applicable
How can iget like below screen shot