cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

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.

 

Capture.PNG

Any ideas would be appreciated

1 ACCEPTED SOLUTION
Super User IV
Super User IV

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

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
Super User IV
Super User IV

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

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

Thank you for the help - it worked!

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors