Forum Discussion

Johann80's avatar
Johann80
New Member
1 year ago
Solved

X-axis not sorted chronoligically

Hi all

I just started using Power BI so I appologize for the basic question πŸ™‚ I tried to create a chart showing the revenue by Month. 

For some reason, the X axis is not sorted chronologically as you can see February and January Months are inverted, reason being (I suppose) is that February Revenues were higher than January ones and the sorting was done by the Y-Axis.

 

I tried to change the sorting in Column Tools, I also tried to create a new data column with Date format change but it does not seem to work

 

I must be missing something πŸ™‚

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Johann80 ,

    Just wanted to check if you had the opportunity to review the suggestion provided?

    If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.

     

    Thank You.

    Harshitha.

    Community Support Team.



6 Replies

  • Hi Johann80 

    1. Create a calculated column using the below formula:
      Month Num = MONTH(Date_Column)

    2. In the Table view, select the column that contains the month names.
      Then, from the Column tools in the toolbar, use the Sort by Column option and choose the Month Num field.

    This will ensure the month names are sorted correctly in your chart as well.


    🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
    πŸ’‘ Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
    πŸŽ– As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
    πŸ”— Curious to explore more? [Discover here].
    Let’s keep building smarter solutions together!

    • Johann80's avatar
      Johann80
      New Member

      Hello

      thanks very much for your answer, I have the below error message when trying to create this new column :

       "Failed to resolve name 'Date_Column'. It is not a valid table, variable, or function name.

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Johann80,
        Thank you for reaching out to the Microsoft fabric community forum.

        I would also take a moment to thank grazitti_sapna  , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

        To fix the month sorting issue, ensure your Month column is set as Text, and you have a separate MonthOrder column with values like Jan = 1, Feb = 2, etc. Then go to Column tools β†’ select Month β†’ Sort by Column β†’ choose MonthOrder. Also, check the visual is sorted by Month, not by Revenue.
        Please find the attached file and screenshot for your reference.

        If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it

        Best Regards,
        Harshitha.
        Community Support Team