Forum Discussion

Ramyaajithkumar's avatar
Ramyaajithkumar
Frequent Visitor
3 years ago

How to mention moth name

 

instead of numeric, i want to mention the month name, can anyone help me how to get to month name here?

 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    If you have no date column, it might be easier to:

    = Table.AddColumn(PriorStepOrTableName, "Month Name", each Date.MonthName(#date(1, [Month Number], 1)), type date)

     

    --Nate

    • BA_Pete's avatar
      BA_Pete
      Super User

       

      True.

      I should have added this as option 1a).  🙂

       

      Pete

  • Hi Ramyaajithkumar ,

     

    There's a couple of ways to do this. In order of preference:

     

    1) If your data has an actual date field in it, then you would create a new custom column a follows:

    Date.MonthName([Date])

     

    2) If your data does not have a date field in it, then you would need to create a conditional column, something like this:

    if [Month number] = 1 then "January"
    else if [Month number] = 2 then "February"
    else if [Month number] = 3 then "March"
    ...

     

    Pete