Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nafta90
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
mahoneypat
Employee
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

 





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

3 REPLIES 3
mahoneypat
Employee
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

 





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


How can iget like below screen shot

vijaykumargade_0-1674322922566.png

 

Thank you for the help - it worked!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.