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
thampton
Helper III
Helper III

Dates not sorting correctly on line graph

I have a date field that i am using as my axis for a line chart. I have dates that are from 2018 and 2019(Jan & Feb are included in this). Whenever i use this field it sorts them out of order.

 

I have tried creating an index column and changing the sort by column on my date field to the index but there was an error saying there cant be more than one value in [Column Name] for the same value in [Index]. 

 

How do i correct?

1 ACCEPTED SOLUTION

hi, @thampton

If i use the 3 dots, it is still out of order as it is sorting alphabetically. I need it to sort in chronological order.

The data type of the field should be text instead of date.

8.JPG

Please check select that field then Modeling->Formatting if it is a date field.

and you could also use Sort by column in Power BI Desktop.

If not your case, please share the sample pbix file. You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.

 

 

 

Best Regards,

Lin

 

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
CallanBuchan
New Member

When I added in a Legend that is what caused my date sorting to go haywire. When I removed legend, the sorting works correctly.
Could this be what is causing you the issue?

without legendwithout legendwith legendwith legend

Have encountered the exact same problem. After couple days of investigation it seems that it's out of order because some elements in the legend dont have data, e.g. a measure that has 0 divided by 0 error. To fix this, make sure the measure is correctly reflected (can put a table to help pinpoint the date, legend element & measure to see).

Anonymous
Not applicable

hello @thampton

 

Do you mean a slicer or table ? not sure what you mean by date field.

 

if yes, click on the three dots "..." and select the order you want it to present.

@Anonymous It is a date field that i am using as the x axis on a ling chart. 

 

If i use the 3 dots, it is still out of order as it is sorting alphabetically. I need it to sort in chronological order.

hi, @thampton

If i use the 3 dots, it is still out of order as it is sorting alphabetically. I need it to sort in chronological order.

The data type of the field should be text instead of date.

8.JPG

Please check select that field then Modeling->Formatting if it is a date field.

and you could also use Sort by column in Power BI Desktop.

If not your case, please share the sample pbix file. You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.

 

 

 

Best Regards,

Lin

 

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@thampton

Ok, could you show a picture(s) as it makes it much easier to understand.. 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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
Top Kudoed Authors