Hello,
I am working on a Location based Canvas App and have a gallery with Title and Subtitle fields that pulls data from a PowerApps collection and the Gallery is sorted in the ascending order by the Sub Title data. The Collection has 660 rows with 2 columns (Location and Distance).
Title (Location Column)
Subtitle (Distance Column)
The sort works fine for first 5 items and then it skips many records and jumps higher as shown below. In between there are many locations between 10 and 90 miles and not sorting properly

My formula is below:
With(
{
Items:
SortByColumns(
Search(
LocationData,
TextSearchBox.Text,
"Title"
),
"Distance", SortOrder.Ascending
)
},
ForAll(
Sequence(CountRows(Items)),
Patch(
Last(
FirstN(Items,Value)),
{ID: Value}
)
)
)
How to fix this and sort all records by Distance column from low to high