Forum Discussion

HishamAT's avatar
HishamAT
Icon for Helper II rankHelper II
3 years ago
Solved

Converting month name to date

Hi,  I have a column in a table as follows :  column Name is : Month column Data Type is : text What i need is to convert it to data type date and with the format of MMM (Only month name). Can y...
  • TomasAndersson's avatar
    3 years ago

    So you only have the text, and no other column with a date to use?

    This calculated columns would work

    Month Name = 
    SWITCH(Table[Month],
       "January", Format (Date(2020,1,1), “mmm”),
       "February", Format (Date(2020,2,1), “mmm”),
    //and so on for the rest of the months
    )

     You would have to adjust the year according to your need. If you are able though, it would be better if you could edit the data source so there are dates to work with. This solution is not very efficient.