Forum Discussion
Sorting of values
Hi avidthinker
Thank you for reaching out to the Microsoft Fabric Community Forum.
It looks like the sorting issue may be caused by mixed data types in your column. Some values (e.g., "5.29.1") are likely stored as text, while others (e.g., "8.03") are stored as numbers. This would explain why "8.03" is treated as larger than "5.29.1" when sorted.
Could you please try changing the column’s data type to text in your Dataflow and check if the sorting issue persists?
Thank you.
- avidthinker1 year agoFrequent Visitor
Hi @v-shamilv,
Thanks for the suggestion, the tricky part in some cases 8.03 is the latest and in some cases 5.29.1 is the latest version.
I tried a mechanism where I look at the length of the Ver field, if its over 4 digits (using a filter) as for example 5.29.1, it works and shows 5.29.1 is the latest after a sort.
For another spreadsheet 8.03 is the latest and when I apply this the above methodology and we now filter 8.03 (4 digit length excluded) it's not the latest.
What makes it challenging the Firmware Build XXXXXXXXX adjacent column has no naming scheme which denotes the latest via alphabetical naming, think I may need another point of reference.- Anonymous1 year agoNot applicable
Hi avidthinker
Since version formats vary, sorting by length alone may not be reliable. A better approach is to split the "Ver" column into major, minor, and patch components using the . delimiter. Convert these to numbers and sort by major > minor > patch in descending order.
If a version has only two parts (e.g., "8.03"), assume a missing patch version as 0 (i.e., treat "8.03" as "8.3.0"). This should ensure correct sorting.
If this solution helps, please consider giving us Kudos and accepting it as the solution so that it may assist other members in the community
Thank you.