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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Omar_204
Helper I
Helper I

DAX - Extract Month name from Date - not working

Hello all,

 

I am trying to extract the month name from a date column and its displaying same as the date.

 

Here is the code I am using:

 

DateTimeMonthYear= ADDCOLUMNS(SELECTCOLUMNS(Morale & Workload List,"Date",'Morale & Workload List [Completion time]),"Month", MONTH([Date]),"Month Name", FORMAT([Date], "mmmm"),	"Year",Year([Date]))

 

The issue is for the Month Name column its display same as the date/time i.e. YYYY-MM-DD HH:MM:SS AM/PM

 

I don't understand why it's not extracting the Month name, can anyone help ?

 

Thank you.

7 REPLIES 7
Omar_204
Helper I
Helper I

I just checked the Completion time field with the Date/Time and the format was Text, not Date/Time. As soon as I changed this, its now showing the Month.

@Omar_204 That would certainly cause problems!! 🙂


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Omar_204
Helper I
Helper I

That's exactly what I am using the same code, so howcome it works here but not on mine. Could it be something to do with the sharepoint list ?

Omar_204
Helper I
Helper I

Hello, 

 

Sorry, thats what I have it uses single quotes but still displays the date and time not the Month

Greg_Deckler
Super User
Super User

@Omar_204 Your syntax looks correct except for not having single quotes around your table name references. I recreated just fine in a PBIX attached below sig.

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hello,

 

I am having the same issue to extract the Month name from a date/time.

 

Here is my code: 

 

DateTempsMoisAnnee = ADDCOLUMNS(SELECTCOLUMNS('Formulaire d''indicateur de moral et de capacité de charge de travail',"Date",'Formulaire d''indicateur de moral et de capacité de charge de travail'[Le temps d'exécution]),"Numbéro de Mois", MONTH([Date]),"Nom du Mois", FORMAT([Date],"mmmm"),"Année",Year([Date]))
 
For the Nom du Mois column, its shows the same as the Date column in the format YYYY-MM-DD HH:MM:SS AM/PM.
 
Omar_204_0-1675270837666.pngOmar_204_1-1675270849216.png

 

Any ideas, I checked the column types and they all seem correct.

 

Also, would it be simple to have the output translated into French ?
January -> Janvier, February -> Fevrier.
 
Or does it only output the result of the DAX code into English ?
 
Thank you.

@Omar_204 What desktop version are you on?

Mine is:

Version
2.108.603.0 64-bit (August 2022)

You could check the Issues forum here:

https://community.powerbi.com/t5/Issues/idb-p/Issues

And if it is not there, then you could post it.

If you have Pro account you could try to open a support ticket. If you have a Pro account it is free. Go to https://support.powerbi.com. Scroll down and click "CREATE SUPPORT TICKET".


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors