Forum Discussion

Curt_DA's avatar
Curt_DA
New Member
9 years ago

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

  • 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...."

  • biconsba's avatar
    biconsba
    Frequent Visitor

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

    • biconsba's avatar
      biconsba
      Frequent Visitor

      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?

  • Eric_Zhang's avatar
    Eric_Zhang
    Icon for Microsoft Employee rankMicrosoft 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.