Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Decimal number sorting with text

Dear community, i have the following decimal numbers with text but Power BI sees .10 coming before .2 in ascending order. How can I sort the numbering?

 

 

  • Hi Anonymous 

     

    There are two ways to achieve your objectives.  

    • 1st way is to make your decimal texts to 2 decimal instead of 1 for single digit decimal numbers. For example .1 - .9 becomes .01 - .09, as shown below.  

     

    • 2nd way is to add an index column using Power Query and sort column according to the index column. 

    Select Add Column > Index Column.

    I attach the pbix file below:

    Index column.pbix

3 Replies

  • Hi Anonymous 

     

    There are two ways to achieve your objectives.  

    • 1st way is to make your decimal texts to 2 decimal instead of 1 for single digit decimal numbers. For example .1 - .9 becomes .01 - .09, as shown below.  

     

    • 2nd way is to add an index column using Power Query and sort column according to the index column. 

    Select Add Column > Index Column.

    I attach the pbix file below:

    Index column.pbix

  • you need to extract the numbers in a separate column in power query and then sort your column by it