Forum Discussion

Vtomsons's avatar
Vtomsons
Helper I
6 years ago
Solved

Sort order for text column

I have a column of fiscal year like below. Power BI defaults this data to Text no matter if I use "/" or "-" to separate the years so the sort by feature column is not accessible. 

 

2020-21

2019-20

2018-19

2017-18

 

So when I do a line graph it defaults to sort by which year has the most data to the least but I want to sort chronolically.

 

Any suggestions?

 

Thanks

 

Val

  • Vtomsons set the sort order in the visual by clicking (...) 3 dots on the top right corner of the visual.

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

  • Hi Vtomsons ,

     

    What's the datatype of your YEAR column? Is it TEXT, if yes then try giving it a date format and then the chart by default takes the chronological order.

    Move this date column to your chart, this will move as an hierecahy - Year, Quarter, Month, Day.

    Then cross Quarter & Day from the hierarchy, you end up with Year & Month.

    On your chart drill to the lowest hiearchy ans you see chart at Year-Month level.

     

    If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

     

    Thanks,

    Pragati

  • my suggestion is to use a proper date field so you can sort it, text is what it says on the tin, it sorts alphabetically, if you can't use a date, split the 2020 and 20 and make them 2 separate columns, you can create a hierarchy, but then you make it a number and sort numerically

3 Replies

  • Vtomsons set the sort order in the visual by clicking (...) 3 dots on the top right corner of the visual.

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

  • Hi Vtomsons ,

     

    What's the datatype of your YEAR column? Is it TEXT, if yes then try giving it a date format and then the chart by default takes the chronological order.

    Move this date column to your chart, this will move as an hierecahy - Year, Quarter, Month, Day.

    Then cross Quarter & Day from the hierarchy, you end up with Year & Month.

    On your chart drill to the lowest hiearchy ans you see chart at Year-Month level.

     

    If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

     

    Thanks,

    Pragati

  • vanessafvg's avatar
    vanessafvg
    Community Champion

    my suggestion is to use a proper date field so you can sort it, text is what it says on the tin, it sorts alphabetically, if you can't use a date, split the 2020 and 20 and make them 2 separate columns, you can create a hierarchy, but then you make it a number and sort numerically