Power BI: sort correctly the month name in chart

When I create a clustered column chart in which I want to make some comparison for instance between different years, the month is not sorting out correctly in spite that I will ask to do so.

power bi

To remediate it, I will need to create a new column with the month ID then sort the name of the month by using the month ID.

power bi

If you have a month name column, just create a new column by putting number from 1 to 12. Once you have it, jump to the last section where I explain the "sort by column" option. In the other hand, if you have a date column. Those are the steps to do it. First I will need to create the month name (January, February, etc.) for that, I will go to the data editor and click on “new column”.

power bi power bi

In the formula bar, put:

FORMAT([argument],"MMMM")

I will get that:

Column = FORMAT([date],"MMMM")

I will change the name “column” by “monthname”:

monthname = FORMAT([date],"MMMM")

Secondly, I will create the month number (1, 2, 3, etc.), so I click again “new column” and in the formula, put:

MONTH([argument])

I will get that:

Column = MONTH([date])

And let’s change the name “column” by “monthid”.

Now click on “sort by column” and select “monthid”.

power bi

I will just have to create my chart and from the chart, I will sort by “monthname” and “sort ascending”.

power bi

Interesting Topics