cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mkwiatkowski Frequent Visitor
Frequent Visitor

Line chart not showing dates chronologically

I Have a line chart that shows days and months, the issue i'm having is i want the chart to show the data chronologically by day/month, right now the chart seems to be ordering by day but rather doing it day-by-day for September and then day-by-day for October its doing it by day number but then sorting months with the same day one after the other. Chart is shown below along with the table:

 

Chart.jpgTable.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Line chart not showing dates chronologically

Hi @mkwiatkowski ,

 

We can use the tooltips field to sort the chart if the x-axis field is based on the column you want to sort, or you have a hierarchy field used as x-axis, just put the date field into the tooltips then set sort as this field

 

8.PNG

 


BTW, pbix as attached.

 

Best regards,

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

 

 

Community Support Team _ Dong Li
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

7 REPLIES 7
DouweMeer Member
Member

Re: Line chart not showing dates chronologically

Either create a date hierarchy by click and drag the dates in a waterfall on top of each other, or use the 'Sort by column' in the modeling tab on top and use your date column for this purpose. 

amkumar5 Member
Member

Re: Line chart not showing dates chronologically

DouweMeer Member
Member

Re: Line chart not showing dates chronologically

That method is not an effective trick for this situation. 

amkumar5 Member
Member

Re: Line chart not showing dates chronologically

@DouweMeer :

If the date column is sourcing Dim/Calendar table from database. Date must be is Unique/PK, then

1. In Power Query Editor', Sort Date column

2. Add Index column

3. Close & Apply

4. From Data view create new column as you wanted.

        DaynumerWithMonthName = FORMAT(Hours[Date],"dd,mmm")

5. Now  in the 'modeling' tab, select the new column and select 'Sort by Column' and choose Index column.

 

Note: If the Date column is not unique from the Source, then select Date column and create new table y selecting 'Add as new Query, then 'Remove Duplictates', THEN convert 'To table'.

 

Community Support Team
Community Support Team

Re: Line chart not showing dates chronologically

Hi @mkwiatkowski ,

 

We can use the tooltips field to sort the chart if the x-axis field is based on the column you want to sort, or you have a hierarchy field used as x-axis, just put the date field into the tooltips then set sort as this field

 

8.PNG

 


BTW, pbix as attached.

 

Best regards,

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

 

 

Community Support Team _ Dong Li
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

mkwiatkowski Frequent Visitor
Frequent Visitor

Re: Line chart not showing dates chronologically

Perfect! thank you, i've now got my chart showing dates chronologically.

DouweMeer Member
Member

Re: Line chart not showing dates chronologically

Why are you guys making your lifes more complicated than necessary? And most important, why are you teaching others to work as complicated as well. The problem lies in the fact that the field is considered text. Thus it sorts alphabetical. You have to let Power BI know it is dealing with a date related value. 

 

Untitled.pngComparisonUntitled2.pngDate column by formatUntitled3.pngDate by default hierarchyUntitled4.pngDate by custom date hierarchy

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors