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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
lavdeep
Advocate I
Advocate I

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"

5 ACCEPTED SOLUTIONS
PattemManohar
Community Champion
Community Champion

@lavdeep Please add a new column in Data Pane as below

Month = Format([DateField],”MMM”)




Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

Thanks for quick response 

 

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

View solution in original post

@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)

 





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

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”)

View solution in original post

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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

11 REPLIES 11
JaimedelaCasa
New Member

Hi, I have just solved it as follows:

  • Click on Add new customized column
  • Insert the following formula

Date.ToText([YourColumnWithDate], "MMM"), type text)

  • In case you want it to return the whole name of the month, use this:

Date.ToText([YourColumnWithDate], "MMMMM"), type text)

 

Hope it helps!

 

Jaime

DianaCueca
New Member

Hello All,

 

 I'm really new on this. I'm trying to get the month name from two columns using an if function.

 

 I need for example if column "Delivery Type" has "Miami_Xdock" it should bring the month name from column "Leg2 Order Received", if not it should bring month name from Column "Leg1 Actual Delivery Date"

 

 I was trying the two below:

IF(Deliveries_db[Delivery Type]="Miami_Xdock",MONTH([Leg2 Order Received],[Leg1 Actual Delivery Date])) This one didn't work

 
IF(Deliveries_db[Delivery Type]="Miami_Xdock",FORMAT([Leg2 Order Received],[Leg1 Actual Delivery Date])) This one brings only the date for column "Leg1 Actual delivery date" (like the if is not working)
 
Hope you can help!

Hello All,

 

i just solved it myself. I used the below and works perfect

 

MONTH = IF(Deliveries_db[Delivery Type]="Miami_Xdock",FORMAT(Deliveries_db[Leg2 Order Received],"mmmm"),FORMAT(Deliveries_db[Leg1 Actual Delivery Date],"mmmm"))
 
regards!
PattemManohar
Community Champion
Community Champion

@lavdeep Please add a new column in Data Pane as below

Month = Format([DateField],”MMM”)




Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Anonymous
Not applicable

its not working for me. I am still getting dates

@Anonymous Please provide more details of your issue, sample data or screenshot of the error/logic that you have used.

Note - Make sure you date column is of type Date datatype instead of Text datatype.




Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




pbiforum.PNGHello, 

I am new to Power BI and learning. In the screenshot u will find the 3 tables in which the center one is the bridge table.

Now I want to find the which and the number of jobs(jobname) under which assignee group got finished, cancelled (Status Attribute).

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”)

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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks for quick response 

 

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

@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)

 





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Helpful resources

Announcements
March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.