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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Converting abbreviated Month(Text) to Month(Date Data type) Format

Hi,

 

I have Month column which of text data type having Month in the format of Jan, Feb, Mar, Apr.... I want to convert to format like January, February in Month format. Because I'm sorting, it is sorted alphabetically. I want to sort by Month only. How I can do that?

 

Thanks

Amit

2 ACCEPTED SOLUTIONS

@Anonymous Yeah, I was afraid of a circular dependency which I why I didn't suggest that approach. You likely need to do that in Power Query Editor with nested if then else statements since Power Query does not have a switch statement. Another way is to duplicate the column and then do a bunch (12) replace steps. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

V-lianl-msft
Community Support
Community Support

Please add a new column in the query editor of the transform data.

Vlianlmsft_0-1628062848514.png

Then select the month column and click Sort by column.

Vlianlmsft_1-1628062981745.png

 

View solution in original post

7 REPLIES 7
V-lianl-msft
Community Support
Community Support

Please add a new column in the query editor of the transform data.

Vlianlmsft_0-1628062848514.png

Then select the month column and click Sort by column.

Vlianlmsft_1-1628062981745.png

 

I received a column of null. 

Greg_Deckler
Community Champion
Community Champion

@Anonymous Well, you will need a numeric "Sort by" column to get the sorting correct. So if you have a date column, just create a column like MONTH([Date]) and then set your Sort by column to that.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Ok, so I have to convert Jan to January. I have a table like this-

 

AMK5461_0-1627494571097.png

I want to convert to this

 

AMK5461_2-1627494744810.png

How I can achieve this? Should I manually create a second table?

 

 

if the tabke contains a date column, follow @Greg_Deckler  suggestion. If not, create a new calculated column using:

Mont number = SWITCH(Table [Month],
"Jan", 1,

"Feb, 2,

"Mar", 3,

"Apr", 4,

"May", 5,

"Jun", 6,

"Jul", 7,

"Aug", 8,

"Sep", 9,

"Oct", 10,

"Nov", 11,

12)

set the data type as whole number.

Then select the month column and in the ribbon select "Sort by column" and choose the month number column.

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

When I do this there is an error- 

 

Failed to save modifications to server. A circular dependency was detected. 

 

 

@Anonymous Yeah, I was afraid of a circular dependency which I why I didn't suggest that approach. You likely need to do that in Power Query Editor with nested if then else statements since Power Query does not have a switch statement. Another way is to duplicate the column and then do a bunch (12) replace steps. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.