cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Re: Extract Month and Year from DateTime field to get MMM-YY

Hi,

 

That should be a DAX formula.  Click on the Data Tab in the black bar on the left hand side and then click on Calculated column formula.  Write this formula in the relevant table

 

=FORMAT([Date 2],"mmmm")

 

Hope this helps.


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

Re: Extract Month and Year from DateTime field to get MMM-YY

Hi Ashish, BIG Thanks for the help. This worked. 

 

One additional challenge i faced is that resultant measure from formula suggested is set up as "Text" field.  I am not able to sort the chart based on calendar months. 

 

Thanks again for guidance and help !!

 

 

Super User
Super User

Re: Extract Month and Year from DateTime field to get MMM-YY

Hi,

 

You are welcome.  Please just Google for "Sort months in PowerBI desktop".  Read the answer by mfhussain here - https://community.powerbi.com/t5/Desktop/Sorting-by-Month-as-Text-Jan-Feb-Mar-etc/td-p/9237


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

Re: Extract Month and Year from DateTime field to get MMM-YY

This does not work on Direct Query model

kkk333 Frequent Visitor
Frequent Visitor

Re: Extract Month and Year from DateTime field to get MMM-YY

What if I have issue.PNG

is the case and we need to sort using the month, meaning all the vlaues from each month, if I am not wrong , I need to create a measure for that but could anyone guide me a bit on this , how I will do it  ?

Highlighted
kausdutt Frequent Visitor
Frequent Visitor

Re: Extract Month and Year from DateTime field to get MMM-YY

I have three months: Feb, Mar, Apr but its showing in alphabetical order: Apr, Feb & Mar

 

How shall I resolve this issue?


@Ashish_Mathur wrote:

Hi,

 

Try this

 

=FORMAT(Data[Date],"mmm-yyyy")

 

Hope this helps.


 

Super User
Super User

Re: Extract Month and Year from DateTime field to get MMM-YY

Hi,

See my post data 6 MArch 2019.  I have shared a link there.


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

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 6 members 1,638 guests
Please welcome our newest community members: