Forum Discussion
How to get the month from text?
- Anonymous2 years ago
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:
Add the following code in the Advanced Editor:#"Add Column"=Table.AddColumn(#"Changed Type","Month_Name",each Text.Middle([Date],4,3),type text)
Create a calculate column :Value_MonthValue_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.
This fails in DAX:
You are better off converting your column type to datetime in Power Query, and then use the FORMAT function in DAX as indicated.