Forum Discussion

JeroenN's avatar
JeroenN
Advocate I
10 years ago
Solved

Sorting date based axes

Power Bi sorts the X axes in a histogram automatically in alphabetic order. Is there a way to change this? I tried to add a numeric column to the axes, but this doesn't seem to work.

Anybody have a suggestion?

Thanks!

 

?

  • Sorry, I am still not 100% up with the correct terminology in Power BI.

    On the home ribbon/menu of Power Bi Desktop, on the left hand side, click on the middle icon (Data view - not table view- sorry).

    Select your table

    select the Name column you want to resort in a different order

    Click on the modelling ribbon/menu

    Click "sort by column", and then select the id column

    Go back to your report (top icon, report view on the left hand side).

7 Replies

  • MattAllington's avatar
    MattAllington
    Community Champion

    If you have a sort order in mind, load that up with your dimension data. Then in the table view, select "sort by column" to sort the Alpha column by the numeric column 

    • JeroenN's avatar
      JeroenN
      Advocate I

      Hello Matt

      I can't get it to work in the right way.

      I've got a very simple table with three columns: CountrId, CountryName and Score. The column CountryId is the column I want to sort the histogram by, but Power Bi sorts the axes in het alphabetic order. 

      What do you mean by 'table view'? 

      • MattAllington's avatar
        MattAllington
        Community Champion

        Sorry, I am still not 100% up with the correct terminology in Power BI.

        On the home ribbon/menu of Power Bi Desktop, on the left hand side, click on the middle icon (Data view - not table view- sorry).

        Select your table

        select the Name column you want to resort in a different order

        Click on the modelling ribbon/menu

        Click "sort by column", and then select the id column

        Go back to your report (top icon, report view on the left hand side).

  • alexpancakes's avatar
    alexpancakes
    Microsoft Employee

    Hi. 

    (1) First you need to sort your "RegionID" (ascending).

    (2) Then you need to sort Counties by this ID. Arrow shows that the first step was succesfully done.

     

    (3) Then you are ready to create your charts. I added name for "region" as a new column with simple IF() statement to visualize the sorting better.