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

Sorting by month in Chronological Order

I have looked at many of the posts on trying to Sort Data by Month in chronological order and the solutions seem ridiculously complicated. If for example you have a simple two column table which consists of "Month" and a "Sales" for that month and you do a simple bar chart the months sort and display alphabetically, not chronologically. It appears that if you add an additional column consisting of numbers and use that to "force" a chronological sort order then the numbers display on the axis instead of the month names (I want the month names to appear). Is it really the case that PowerBI does not have embedded intelligence to recognize that a month name is a chronological attribute and that data should by default sort in chronological order (unless you explicitly select some other sort option)??? My question is simply; what is the easiest solution to sorting by month in chronological order while having the month name appear on the axis instead of some made up field name that was created solely to force a sort in the desired order.

 

Thanks...

4 REPLIES 4
Eric_Zhang
Employee
Employee

@


@Curt_DA wrote:

I have looked at many of the posts on trying to Sort Data by Month in chronological order and the solutions seem ridiculously complicated. If for example you have a simple two column table which consists of "Month" and a "Sales" for that month and you do a simple bar chart the months sort and display alphabetically, not chronologically. It appears that if you add an additional column consisting of numbers and use that to "force" a chronological sort order then the numbers display on the axis instead of the month names (I want the month names to appear). Is it really the case that PowerBI does not have embedded intelligence to recognize that a month name is a chronological attribute and that data should by default sort in chronological order (unless you explicitly select some other sort option)??? My question is simply; what is the easiest solution to sorting by month in chronological order while having the month name appear on the axis instead of some made up field name that was created solely to force a sort in the desired order.

 

Thanks...


@Curt_DA

My opinion is that it is always a good practice to use  the full date instead of a single month name, eg, 2017-01-01, 2017-02-01 instead of Jan, Feb. Then Power BI would recogine the date filed and show as how you let it show. See the attached demo.

 

Capture.PNGCapture.PNG

 

 

biconsba
Frequent Visitor

Is it possible to sort By year then by month and then by day?

Thank you for your reply. You are right it's a good practice for time dimension but in some cases you need to use a special sorting even in time dimension (no doubt in all other dimension types) . e.g. Year descending, Month Ascending.

Any way to do it in Power BI?

mattbrice
Solution Sage
Solution Sage

Create another column like "Month Number", then use the "Sort by Column" in table Modeling section on the "Month Name" column.  That is what the feature is intented for.  So when you put the month name in a visual it sorts the way you expected "Jan, Feb, Mar, Apr...."

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.