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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
hkpowerbi
Regular Visitor

Month and year field

Hi All,

I have a separate field from the DB for month, another for year. Both of these are text fields, and not date/time. When I bring in month into a visualization, it is sorting by alphabetical order. Any way to get it to sort by Jan, Feb, March, etc? Any workaround? Thanks
2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @hkpowerbi,

 

Could you please mark the proper answer if it's convenient for you? That will be a help to others.

 

Best Regards!
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @hkpowerbi,

 

We could add a column "MonthNum", then sort month by "MonthNum". It would work.

1. Add "MonthNum" in Query Editor. (Add Conditional Column.)

 

Month and year field.jpg 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2. Change the type of "MonthNum" into "Whole Number".

3. Click Month, click "Sort by column", choose "MonthNumber".Month and year field2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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