Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Line Chart unordered dates

I have created a power BI graph which includes a column for dates. 

 

I've used this date column to create a Line Chart, with dates on the x axis. It has worked fine.

[dates range from april 2020 - Oct 2020]

 

Because my Power BI report is conntected to our SQL Server, I have appended the corrosponding sql table with new data. 

This new data ranges from [Nov 2020 - Feb 2021]. After that i refreshed the power BI table and all is well.

 

But when i refresh the power BI report, the months in 2021 are found at the front of the line chart, not after december 2020.

see below:

 

 

Why is this happening? It seems to think that these 2 months (january and february) are in 2020, but they are in 2021.

 

  • Just wondering if you are using the PBI Auto Time Date and if this is currently showing up as categorical data in the field well.  If so then the fix is to drill down using the Expand all rather than Drill to the next level in the hierarchy.

     

    Just in case my guess is right.

    - Drill back to top level (Year)

    - Ensure X is continuous

    - Use Expand all to drill down

     

    This is what I ended up with

    Please mark as the answer if this works or 'like' if it helped.  All kudos appreciated. 

13 Replies

  • Just wondering if you are using the PBI Auto Time Date and if this is currently showing up as categorical data in the field well.  If so then the fix is to drill down using the Expand all rather than Drill to the next level in the hierarchy.

     

    Just in case my guess is right.

    - Drill back to top level (Year)

    - Ensure X is continuous

    - Use Expand all to drill down

     

    This is what I ended up with

    Please mark as the answer if this works or 'like' if it helped.  All kudos appreciated. 

    • Anonymous's avatar
      Anonymous
      Not applicable

      This seemed to have done it! thanks 

       

  • Hi Anonymous 

    Are you sure the chart is sorting by date and not by month number, irrespective of the year?

    Can you please supply some sample data showing the dates in question.

    Regards

    Phil

    • Anonymous's avatar
      Anonymous
      Not applicable

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Also when i arrange the column by descending, the dates are arranged correctly. the top is the latest appended values from feb 2021, and everything seems ordered properly all the way down

    • Anonymous's avatar
      Anonymous
      Not applicable

      Where do I upload an excel spreadsheet for viewing? 

      • PhilipTreacy's avatar
        PhilipTreacy
        Super User

        HI Anonymous 

        When you reply please @ mention me otherwise I don't get a notification that you've replied.

        Type @ and then choose my name from the list.

         

        You can upload the Excel file toOneDrive or DropBox and then share a link to it here.

        Regards

        Phil

    • Anonymous's avatar
      Anonymous
      Not applicable

      Apologies I'm unable to do that. Is there anything I can on my end to help you understand the data?

      • PhilipTreacy's avatar
        PhilipTreacy
        Super User

        Anonymous 

        Providing the column of dates.  I can make up some data values.

        Regards

        Phil

  • Anonymous ,

    You can take Year-Month combination and then I don't think you will face this issue.

     

     

    Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

    Proud To Be a Super User !!!
    LinkedIn

    • Anonymous's avatar
      Anonymous
      Not applicable

      I still face this issue when i do that