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

how to reorder dates on X-axis of the charts

Hi everyone,

I created a few charts in power bi (line chart, 100% stacked column chart, stacked column chart). The X-axis shows the date of each week (my week runs from every Thursday to Wednesday). 

 

Below is a screenshot of one of the X-axis. I see that 6/15 is before 6/8 and I tried to sort axis asceding by 'start of week' but it didn't work. Can someone let me know how to make them in the correct order please? I have a calendar table and one column being 'start of week'.

 

Annotation 2023-06-19 095552.png

This is how the order of the date in my calendar table looks like:

Annotation 2023-06-19 102454.png

 

Thank you!

2 ACCEPTED SOLUTIONS
vicky_
Super User
Super User

You need to change the type of your dates. Right now, they are being sorted as if they were strings. 
Power Query can do that for you - guide here

View solution in original post

PhilipTreacy
Super User
Super User

Hi @kathyyy19 

 

Are you actually plotting the date on the x axis?  Looks like you are not, if you are using a text field like the 'Start of Week' you created, you'll get this issue because the values on your x axis are actually text, not dates.

 

Try just using the date on the x-axis.

 

Regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

4 REPLIES 4
PhilipTreacy
Super User
Super User

Hi @kathyyy19 

 

Are you actually plotting the date on the x axis?  Looks like you are not, if you are using a text field like the 'Start of Week' you created, you'll get this issue because the values on your x axis are actually text, not dates.

 

Try just using the date on the x-axis.

 

Regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Thank you Philip! I think I figured it out. Yes, you are right. My dates are in text format not dates so I transformed them into dates. Then I used format visual->x-axis->type, and changed type from 'continuous' to 'categorical' and the x-axis are now showing start of week dates. 

vicky_
Super User
Super User

You need to change the type of your dates. Right now, they are being sorted as if they were strings. 
Power Query can do that for you - guide here

Thank you Vicky for your help!!

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.