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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to get the month from text?

My column contains dates in this format "Mon Jan 01 07:15:36 2024". Now how do I get the month? I want another column that will contain the word January. I tried the format() thing but its throwing errors FORMAT(MAX(‘table‘[column]),“mm“).

 

Help would be appreciated.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,@Anonymous.Hello, @lbendlin ,Thank you very much for your help of this issue.Your solution looks great!
Now I want to share another suggestion with you.

I am glad to help you.

According to your description, you want to change the Description of the records within the last one year to another color in order to highlight them?

If I understand you correctly, then you can refer to my solution.

 

Here is the test data I created.


Here is my test Data:

vjtianmsft_0-1716195686875.png



vjtianmsft_1-1716195686896.png

 


Add the following code in the Advanced Editor:

    #"Add Column"=Table.AddColumn(#"Changed Type","Month_Name",each Text.Middle([Date],4,3),type text)

vjtianmsft_0-1716195777944.png

 

vjtianmsft_1-1716195783998.png


Create  a calculate column :Value_Month

vjtianmsft_2-1716195809388.png

Value_Month = 
SWITCH(TRUE(),
[Month_Name]="Jan",1,
[Month_Name]="Feb",2,
[Month_Name]="Mar",3,
[Month_Name]="Apr",4,
[Month_Name]="May",5,
[Month_Name]="Jun",6,
[Month_Name]="Jul",7,
[Month_Name]="Aug",8,
[Month_Name]="Sep",9,
[Month_Name]="Oct",10,
[Month_Name]="Nov",11,
[Month_Name]="Dec",12
)

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi,@Anonymous.Hello, @lbendlin ,Thank you very much for your help of this issue.Your solution looks great!
Now I want to share another suggestion with you.

I am glad to help you.

According to your description, you want to change the Description of the records within the last one year to another color in order to highlight them?

If I understand you correctly, then you can refer to my solution.

 

Here is the test data I created.


Here is my test Data:

vjtianmsft_0-1716195686875.png



vjtianmsft_1-1716195686896.png

 


Add the following code in the Advanced Editor:

    #"Add Column"=Table.AddColumn(#"Changed Type","Month_Name",each Text.Middle([Date],4,3),type text)

vjtianmsft_0-1716195777944.png

 

vjtianmsft_1-1716195783998.png


Create  a calculate column :Value_Month

vjtianmsft_2-1716195809388.png

Value_Month = 
SWITCH(TRUE(),
[Month_Name]="Jan",1,
[Month_Name]="Feb",2,
[Month_Name]="Mar",3,
[Month_Name]="Apr",4,
[Month_Name]="May",5,
[Month_Name]="Jun",6,
[Month_Name]="Jul",7,
[Month_Name]="Aug",8,
[Month_Name]="Sep",9,
[Month_Name]="Oct",10,
[Month_Name]="Nov",11,
[Month_Name]="Dec",12
)

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

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

lbendlin
Super User
Super User

This fails in DAX:

lbendlin_0-1715775337850.png

You are better off converting your column type to datetime in Power Query, and then use the FORMAT function in DAX as indicated.

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.