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
Anonymous
Not applicable

How to convert Date format in "MMM-YY" but order sequence become problem

Hi,

 

I have a question in which I want my date format in my visualisation to "MMM-YY", I know I can make use of the following DAX to perform and get the format I want:

=FORMAT(Data[Date],"MMM-YY")

 

However, the above format will convert the Date into a Text. This become a problem in which my Visualisation will not show in the sequence of the monthly order. For example, you notice from the following graph in which the order run out because date become a text format.

 

Any idea? thanks..Tuff

 

Capture.JPG

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Select a column in Fields. Then go to Modelling tab. Go to Sort by column and select the desired column to be used in sorting selected column.

 

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

 

Create another column like

YearMonth = (YEAR(Data[Date])*100)+MONTH(Data[Date])
 
Use this column for sorting order of formated date column.
 
I hope this will solve your problem.
Anonymous
Not applicable

Hi ORBI,

 

I had created a calculated column with the text format (YearMonthShort) I want and this column refer to another column (Reporting Month) in my query.

Hence, how do you sort and how do you sort in the visualisation? Thanks

 

c1.JPG

In DataView. Once click on any column. You will sort on column View. Click on this column and choose the sort column.

 

There best sort column for month year is YYYYMM. Create it using format.

Anonymous
Not applicable

Select a column in Fields. Then go to Modelling tab. Go to Sort by column and select the desired column to be used in sorting selected column.

 

 

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.