Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
dylanndengu
Helper I
Helper I

Sort by Month AND Year

Hi Everyone,

 

I am having problems sorting out my date variable to fit my graph chronologically. 

To give you some context, our financial year runs from July 2020 to June 2021, and the data I have is currently from July 2020 up to end of January 2021. Now, for the past six months I've been creating dashboards which look like below:

 

dylanndengu_1-1614247287665.png

 

 

As you can see, the month is what is in the x-axis and is in chronological order from July to December up to 2020. However, now that I want to add January 2021 numbers, the graph comes out  below:

 

dylanndengu_2-1614247383276.png

 

As you can see, this is not a correct chronological order since the figures for January 2021 are ahead of the July-December 2020 numbers. Furthermore, if  try add "Year" to my current date hierachy, my graph looks like this:


dylanndengu_3-1614247537723.png

dylanndengu_4-1614247559962.png

 

I have seen other solutions stating that if you change the data type to "Date" it will sort chronoligically but this is not the case, as you can see. Hence, I am coming to ask for assistance in re-arranging my graph to be in the correct chronoligcal order of July to December 2020 followed by January 2021 and not have the January figures placed where they currently are.

 

I hope the context provided here is enough to gain your assistance.

 

 

1 ACCEPTED SOLUTION
dylanndengu
Helper I
Helper I

Hi, after further experimentation, I realised the solution was actually quite simple. On your graph, you can simply click those 3 dots at the top of your graph and then select "sort by", then select Month as shown below:

 

dylanndengu_1-1614322866457.png

 

As you can see, it is now in the order I wanted it to be. 

 

Thanks so much for your contributions everyone.

 

Kind regards,

Dylan

 

View solution in original post

4 REPLIES 4
dylanndengu
Helper I
Helper I

Hi, after further experimentation, I realised the solution was actually quite simple. On your graph, you can simply click those 3 dots at the top of your graph and then select "sort by", then select Month as shown below:

 

dylanndengu_1-1614322866457.png

 

As you can see, it is now in the order I wanted it to be. 

 

Thanks so much for your contributions everyone.

 

Kind regards,

Dylan

 

What if Month is not showing here 

 

krishanw_0-1671902448521.png

 

 

amitchandak
Super User
Super User

@dylanndengu , Create a month -year column  with sort column or month and year column with sort for month and use those

 

Month Year = FORMAT([Date],"mmm-yyyy")
Month Year sort = FORMAT([Date],"yyyymm")

 

Month Year = FORMAT([Date],"mmm")
Month Year sort = FORMAT([Date],"mm")

 

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak , thank you for your response. However, I tried the method suggested and it has produced the following:

 

dylanndengu_0-1614249220154.png

 

Which is not necessarily correct. I would like it to go from July 2020 to January 2021 in chronological order.

 

Kind regards,

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.