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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Adding month names and sorting accordingly

Hello,

 

I have a report with a direct connection to SQL, with the column of months listed as numbers from 1 to 12.

Now, in my visuals, I would like to present these months with names (Jan to Dec), and then sort them chronologically.

How can I add a new column, that would provide me with month names, depending on the number of the month?

So, if I have number 1, I would like a "January" in a column next to it... Hope I am clear.

And the reporting is updating itself. Currently I only have months from 1 to 6, and soon the 7 will be imported. I would like to have a July for it ready 🙂

 

Thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

In your Date table using Power Query, use:

 

Table.AddColumn(#"Replace_with_previous_step_name", "Month Name", each Date.MonthName([Date]), type text)

 

This way, you have a column of Month names in your Date table. Make sure you also have that column of Month Numbers in the same date table. Then, once you have loaded everything and are in the main interface, go over to the Table view and open your date table. Select the Month Name column, click Sort By, and select the month number column. Once this is done, your model will show the correct order of months.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

In your Date table using Power Query, use:

 

Table.AddColumn(#"Replace_with_previous_step_name", "Month Name", each Date.MonthName([Date]), type text)

 

This way, you have a column of Month names in your Date table. Make sure you also have that column of Month Numbers in the same date table. Then, once you have loaded everything and are in the main interface, go over to the Table view and open your date table. Select the Month Name column, click Sort By, and select the month number column. Once this is done, your model will show the correct order of months.

Anonymous
Not applicable

I didn't know where to enter that in Power Query, but you pointed me in the right direction. I added a conditional column in Power Query, and then sorted the column by the month numbers. Thank you.

amitchandak
Super User
Super User

@Anonymous , if you have a number for month, You can mark that as sort columns. Else you have to create one

 

Sort Month.png

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

All I have is a number column for month. And I would like to add your "Month" column that you have selected in the screenshot, to finally sort it by that.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors