Forum Discussion

RL1's avatar
RL1
Frequent Visitor
9 years ago

Natural sort order for text

Is there a simple way to sort data in a natural order in PowerBI?

 

i.e. being able to sort a text column to be ordered as:

 

A1, A2, A10, A11, A12, A20, A21

 

instead of:

 

A1, A10, A11, A12, A2, A20, A21

 

Thanks.

6 Replies

  • MarcelBeug's avatar
    MarcelBeug
    Community Champion

    It depends on the definition of "Natural"...

     

    My suggestion would be to add a column with the numeric part, sort on that column and then remove that column, as illustrated in this 30 sec video.

  • RL1 As a workaround you can edit query. Split column by number of characters, use 1 left split , get a new numerical column and sort on that.

     

    Hope it helps!!