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

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

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 !!

 

 

Highlighted
Super User IV
Super User IV

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
New Member

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

This does not work on Direct Query model

kkk333
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  ?

kausdutt
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 IV
Super User IV

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/
estherleethiyal
New Member

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

Hi Ashish

 

How can sort by Jan-2019-Dec-2019 instead of date?

 

Please help

Thanks

Sameer

 

kausdutt
Frequent Visitor

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

Hello Guys,
The process is quite simple.
Create a New Column as:

Modified Date = FORMAT('table name'[date column], "yyyy mm dd")

This will help you in mapping:

Jan 2019 -> 2019 01 01

Feb 2019 -> 2019 02 01

.

.

Dec 2019 -> 2019 12 01

Now build your visualization and use the sort option to sort it using the Modified Date column in ascending
Hope this helps.
Let me know if you need anything else.

 

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors