Hello PowerApps Guru.
I have a gallery with location details in it.
I would like to filter the items using my controls (TextSearchBox1 and Dropdown1).
And once they're filtered, I'd also like to sort the distance by adding a new column called dist.

Here is what I write for Gallery items:
SortByColumns(
Search(
If(
Dropdown1.Selected.Value = "ALL",
DATA_SHEET,
Filter(
DATA_SHEET,
Kategori.Value = Dropdown1.Selected.Value
)
),
TextSearchBox1.Text,
"field_Display",
"field_Ruas",
"field_Nama",
"field_Kota_lokasi"
),
AddColumns
(DATA_SHEET,
"dist",
3958.818 * ((2 * Asin(Sqrt((Sin((Radians(Location.Latitude) - Radians(Latitude)) / 2) ^ 2) + Cos(Radians(Location.Latitude)) * Cos(Radians(Latitude)) * (Sin((Radians(Location.Longitude) - Radians(Longitude)) / 2) ^ 2)))))
),
"dist",
If(
SortDescending1,
Descending,
Ascending
)
)
// this is returning red lines 😒
I've searched the forum but didn't seem to find the answer.
Helps and suggestions will be greatly appreciated.
Thank you