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
jbrolland
Frequent Visitor

How to get month and year sorted in the same chart

Hello

I am running in the following issue.

 

data is like this

dateTime spent
2020-12-10        1
2021-01-04        4
2021-03-18

        2

 

Current behavior

I got December 2020 coming after April 2021

jbrolland_0-1618543986486.png

 

jbrolland_1-1618544045442.png

 

Expected behavior

To have December to be before January 2021 in the graph

 

Thanks in advance for your help

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jbrolland , Try to sort again from three dots. I usually create a date table with month and month sort. I sort month on the month sort and use that. 

 

But in this case, Dec will come after April because it December.

On X-axis put both month year and try. Let the year be on column too

 

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

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@jbrolland , Try to sort again from three dots. I usually create a date table with month and month sort. I sort month on the month sort and use that. 

 

But in this case, Dec will come after April because it December.

On X-axis put both month year and try. Let the year be on column too

 

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

Perfect it worked, I actually just needed to Sort by month from the three dots menu

 

jbrolland_0-1618547505308.pngjbrolland_1-1618547532438.png

 

Thanks a lot

I check this too fast, it actually not sorting properly

  • I ended up concateneting Year and Month in a new colum as text

jbrolland_0-1618549184220.png

  • Then sorting ascending by the new colum called Year and Month

jbrolland_1-1618549345205.png

 

Not super cleanas  I don't have the month name but did not find any better

I was served by your solution! Thanks a lot

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.