Forum Discussion

lavdeep's avatar
lavdeep
Advocate I
7 years ago
Solved

How to extract month name from date

HI,   i have colunm where date format "DD/MM/YYYY" i want to extract only month name like this "MMM" formate "Jan"
  • PattemManohar's avatar
    7 years ago
    lavdeep Please add a new column in Data Pane as below

    Month = Format([DateField],”MMM”)
  • lavdeep's avatar
    lavdeep
    7 years ago

    Thanks for quick response 

     

    Month column showing in field list when in enter query editor column not show ??

  • PattemManohar's avatar
    PattemManohar
    7 years ago

    lavdeep  Calculated columns and Tables that are created under Data Pane can't be visible/accessible under Power Query Editor. In that case, add a new field in Power Query Editor to extract the Month as below using "Custom Column" under Add Column tab.

     

    = Table.AddColumn(#"Changed Type", "NewFieldNameMMM", each DateTime.ToText([DateField], "MMM"), type text)

     

  • kkk333's avatar
    kkk333
    7 years ago

    so if my date is 24/6/2019 and I would like to get a separate column with the month name fro all the dates.

    so i should use the below., rite but in this case I am getting error for the word Format sazing its mispellt.

    Format([DateField],”MMM”)

  • Ashish_Mathur's avatar
    Ashish_Mathur
    7 years ago

    Hi,

    Yours is a calculated column formula (not a M Language formula).  I think you are trying to write that formula in the Query Editor - do not write it there.