Forum Discussion
Anonymous
2 years agoNot applicable
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:
3 Replies
- DataNinja777Super User
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:
- AhmedxSuper User
you need to extract the numbers in a separate column in power query and then sort your column by it
- AhmedxSuper User