Forum Discussion

Martin_Machovec's avatar
Martin_Machovec
Regular Visitor
1 year ago
Solved

Graf Y axis data sorting

Got this graf but I want to switch the order of years on y axis from oldest beeing on the top to the lates on the bottom, so far i tried variaty of different aproches including adding new culumn and table with sorting indexes, unfortunetly, none of these worked. Very simple stuff in excell in Power Bi total nightmare. Consulted with Copilot and chat GPT, tried variety of different aproches with no luck. Is it even possible? Thank you for any advice

 

 

  • dm-p's avatar
    dm-p
    1 year ago

    It can already be done in the core product. If you're using a numeric field, ensure that your axis field is set to Categorical rather than Continuous (which is the default for numeric columns), e.g.:

     

     

    This will ensure that the visual has a discrete entry on the scale for each unique value. Then, you can sort your field as usual, e.g.:

     

     

    The chart is now sorted in ascending order of year as required, e.g.:

     

     

    Regards,

     

    Daniel

4 Replies

  • Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
    Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
    Please show the expected outcome based on the sample data you provided.

    Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
    Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

    • Martin_Machovec's avatar
      Martin_Machovec
      Regular Visitor

      This is required solution: 

      How ever somethink that is done with excel in a second takes unfortunetlly very long in Power BI and you need to use python for that, because of all the limitations that are provided with Power Bi. So not a issue for me anymore and this matter can be closed. But to MS developers if you are reeding this, come on... wake up this stuff is not so hard to implement. 

      • dm-p's avatar
        dm-p
        Super User

        It can already be done in the core product. If you're using a numeric field, ensure that your axis field is set to Categorical rather than Continuous (which is the default for numeric columns), e.g.:

         

         

        This will ensure that the visual has a discrete entry on the scale for each unique value. Then, you can sort your field as usual, e.g.:

         

         

        The chart is now sorted in ascending order of year as required, e.g.:

         

         

        Regards,

         

        Daniel