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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
polaris3028
Helper III
Helper III

Sort Graph by Month and Year

Capture.PNG

Hi All,

 

Help needed. Can I have this graph sorted to have (left to right), Jan 2018, Dec 2017, Nov 2017 so on...?

 

Thanks,

Paul

6 REPLIES 6
JordanJSA
Frequent Visitor

Hi Polaris,

 

You could create a new column in your table in the query editor and input the order in which you wish to see the dates by creating an index e.g.
Jan 2018 = 1
Dec 2017 = 2
Nov 2017 = 3

Once you've done that then sort the graph via the index created. But i would advise creating the table oldest date to newest for ease of use. 

good solution, I could solved the same problem thank to your comment. 

Hi Jordan,

 

Actually, the X-axis I used in this graph is from a Date table using the combined fields of month and year.

 

 InsertCalendarMonth = Table.AddColumn(InsertMonthName, "MonthInCalendar", each (try(Text.Range([MonthName],0,3)) otherwise [MonthName]) & " " & Number.ToText([Year])),

 

Can you walk me through on how I can create a new column with index as suggested above?

 

Thanks

Hi Polaris, 

 

Okay, what source did you upload the data from? Excel? 

 

 

Hi  Jordan - not sure what source of what data you're asking.  The Date table was created in PowerBI itself (as a query).  The data is coming from Google sheets. 

 

So, basically I have two tables, one as datasource and a Date table for the calendar.  The X-Axis presented in this graph that I wanted to sort out is using the concatenated Month and Year columns from the Date table.  If I have to create a new column like what you said with Index, which table should I create it? and How?

 

Thanks

 

Hi Polaris, 

 

I've been looking into this and I'm not sure that this can be done within PowerBI. The index feature within PowerBI naturally orders the values 1,2,3.. Which wouldn't return the output you need. An alternative would be to create the index within Google docs if possible and then once loaded into PowerBI you would have the order that you require and you could sort by this value. 

 

thanks 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors