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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mkane12
Frequent Visitor

sorting months in order

how can I sort my months in order? 

mkane12_0-1752081496444.png

 

1 ACCEPTED SOLUTION

Hi @mkane12 ,

 

Thank you for your follow-up, and you’re correct to highlight that. If you’re already using a date table, such as a Calendar table with all dates included, there’s no need to create a separate Month table just for sorting. You can sort the month names directly in your existing date table.

Make sure your table has a column for the month name (like "January", "February") and another for the month number (1 to 12).

 

Thank you.

 

View solution in original post

13 REPLIES 13
parry2k
Super User
Super User

@mkane12 if you don't have a sorting column (month number) on which you want to sort month names, nothing will work. You need to create a column for sorting. Read more about it here Sort one column by another column in Power BI - Power BI | Microsoft Learn



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

v-tejrama
Community Support
Community Support

Hi @mkane12 ,

Thanks for reaching out to the Microsoft fabric community forum.

 

I encountered the same problem with the months displaying alphabetically instead of from January to December. To resolve it, I built a separate Month Table with two columns: MonthName (e.g., January, February) and MonthNum (1–12). I then used the "Sort by Column" feature on MonthName, sorting it by MonthNum.

 

Using this MonthName in the visual ensures the months now appear in the correct calendar order.

 

Please find the attached .pbix file for your reference.

 

Best Regards,
Tejaswi.

this doesn't work as I already have a table with dates, so that table needs the order. 

Hi @mkane12 ,

 

Thank you for your follow-up, and you’re correct to highlight that. If you’re already using a date table, such as a Calendar table with all dates included, there’s no need to create a separate Month table just for sorting. You can sort the month names directly in your existing date table.

Make sure your table has a column for the month name (like "January", "February") and another for the month number (1 to 12).

 

Thank you.

 

Hi @mkane12 ,

 

Just checking in have you been able to resolve this issue? If so, it would be greatly appreciated if you could mark the most helpful reply accordingly. This helps other community members quickly find relevant solutions.

Thank you.

 

Hi @mkane12 ,

 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please Accept it as a solution so that other community members can find it easily.

 

Thank you.

 

Hi @mkane12 

 

I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you.

 

Thank you.

 

Hi @mkane12 ,

 

Just checking in have you been able to resolve this issue? If so, it would be greatly appreciated if you could mark the most helpful reply accordingly. This helps other community members quickly find relevant solutions.

 

Thank you.

MasonMA
Memorable Member
Memorable Member

@mkane12 

 

Hi, my advise would be,

create your date table with Power Query Guru Melissa De Korte's ultimate date function in Power Query. https://forum.enterprisedna.co/t/melissa-date-table-replacing-fiscal-to-financial-year/58870/4

 

Keep the Month number or Year number as part of your date table (or you can add any other necessary columns later). This would save you a lot of time writing/having AI generate DAX later. 

After date table loaded into Power BI, build one to many relationship with your fact table so that this Data table can filter your fact table. 

Sort by Month number under Data view, or if in other types of visuals you can sort them in tooltips as well. 

burakkaragoz
Community Champion
Community Champion

Hi @mkane12 ,

 

Thanks for your question! Sorting months in the correct chronological order is a common challenge in Power BI, especially when months are stored as text.

Here's how to fix it:

  1. Create a Month Number Column\ If your month names are in a column (e.g., "January", "February", etc.), create a new column that assigns a number to each month:

    MonthNumber = 
    SWITCH(
        TRUE(),
        'YourTable'[Month] = "January", 1,
        'YourTable'[Month] = "February", 2,
        'YourTable'[Month] = "March", 3,
        'YourTable'[Month] = "April", 4,
        'YourTable'[Month] = "May", 5,
        'YourTable'[Month] = "June", 6,
        'YourTable'[Month] = "July", 7,
        'YourTable'[Month] = "August", 8,
        'YourTable'[Month] = "September", 9,
        'YourTable'[Month] = "October", 10,
        'YourTable'[Month] = "November", 11,
        'YourTable'[Month] = "December", 12
    )
  2. Sort by Month Number

    • Go to the Data view.
    • Select the column with month names.
    • In the ribbon, click Sort by Column and choose the MonthNumber column.

This will ensure your months appear in the correct order in visuals and tables.

For more on sorting in Power BI, check out:
https://learn.microsoft.com/power-bi/create-reports/desktop-sort-by-column

Let me know if your months are part of a date field or if you need help adapting this to your model!


If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.

This response was assisted by AI for translation and formatting purposes.

hi, my months are part of a date field, I do not have a column with just Months

Hi,

You should create a Calendar table with calculated column formulas for Month name, Month order and Year.  Sort the Month name by the Month number.  Create a relationship (Many to One and Single) from the Date column of your Fact table to the Date column of your Calendar table.  To your visual, drag Month name from the Calendar table.  Create a ytear slicer from the Calendar table and select a year.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @mkane12 ,

This wouldn't be a good long-term strategy, but for now if you just wanted to sort them with a simple way, you'd still need to extract your MonthNumber from your date by creating one new calculated column. (To use below DAX, You date should be in 'Date' data type, not 'Text' data type)

MonthNumber = MONTH('Table'[Date])

then Select MonthName column by going to Column tools, Sort by column 'MonthNumber'.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors