Hi @Anonymous ,
Could you please share a bit more about your scenario?
Do you want to calculate the distance between two different address (city, state)?
The user @NickK has faced similar issue with you, please check the response within the following thread:
https://powerusers.microsoft.com/t5/General-Discussion/Sort-gallery-by-closest-location-after-search-is-it-possible/m-p/183247
On your side, you should convert the corresponding address into proper location value (Latitude and Longitude) using the BingMaps.GetLocationByAddress() function (Bing Maps connector supports). Then you could calculate the distance between two difference location values using solution mentioned in above thread I provided.
I have made a test on my side, please take a try with the following workaround:
Firstlt, you need to add a Bing Maps connector within your app.


Within the Gallery, add a Text Input control, set the Default property to following:
Acos(
Cos(Radians(90-BingMaps.GetLocationByAddress({adminDistrict:Last(Split(TextInput6.Text, ", ")).Result, locality:First(Split(TextInput6.Text, ", ")).Result}).point.coordinates.latitude))*Cos(Radians(90-BingMaps.GetLocationByAddress({adminDistrict:Last(Split(ThisItem.'Hometown/State', ", ")).Result, locality:First(Split(ThisItem.'Hometown/State', ", ")).Result}).point.coordinates.latitude))+Sin(Radians(90-BingMaps.GetLocationByAddress({adminDistrict:Last(Split(TextInput6.Text, ", ")).Result, locality:First(Split(TextInput6.Text, ", ")).Result}).point.coordinates.latitude))*Sin(Radians(90-BingMaps.GetLocationByAddress({adminDistrict:Last(Split(ThisItem.'Hometown/State', ", ")).Result, locality:First(Split(ThisItem.'Hometown/State', ", ")).Result}).point.coordinates.latitude))*Cos(Radians(BingMaps.GetLocationByAddress({adminDistrict:Last(Split(TextInput6.Text, ", ")).Result, locality:First(Split(TextInput6.Text, ", ")).Result}).point.coordinates.longitude-BingMaps.GetLocationByAddress({adminDistrict:Last(Split(ThisItem.'Hometown/State', ", ")).Result, locality:First(Split(ThisItem.'Hometown/State', ", ")).Result}).point.coordinates.latitude))
)*6371
On your side, you should set the Text property of the Label control to following:
Acos(
Cos(Radians(90-BingMaps.GetLocationByAddress({adminDistrict:Last(Split(TextInputBox.Text, ", ")).Result, locality:First(Split(TextInputBox.Text, ", ")).Result}).point.coordinates.latitude))*Cos(Radians(90-BingMaps.GetLocationByAddress({adminDistrict:Last(Split(ThisItem.'Hometown/State', ", ")).Result, locality:First(Split(ThisItem.'Hometown/State', ", ")).Result}).point.coordinates.latitude))+Sin(Radians(90-BingMaps.GetLocationByAddress({adminDistrict:Last(Split(TextInputBox.Text, ", ")).Result, locality:First(Split(TextInputBox.Text, ", ")).Result}).point.coordinates.latitude))*Sin(Radians(90-BingMaps.GetLocationByAddress({adminDistrict:Last(Split(ThisItem.'Hometown/State', ", ")).Result, locality:First(Split(ThisItem.'Hometown/State', ", ")).Result}).point.coordinates.latitude))*Cos(Radians(BingMaps.GetLocationByAddress({adminDistrict:Last(Split(TextInputBox.Text, ", ")).Result, locality:First(Split(TextInputBox.Text, ", ")).Result}).point.coordinates.longitude-BingMaps.GetLocationByAddress({adminDistrict:Last(Split(ThisItem.'Hometown/State', ", ")).Result, locality:First(Split(ThisItem.'Hometown/State', ", ")).Result}).point.coordinates.latitude))
)*6371
Note: The TextInputBox represents the Text Input control within your app, where the user could enter a city and state. The 'Hometown/State' represents the 'Hometown/State' column in your SP list.
You could consider take a try to round above distance result to the 2 number of decimal places, please take a try with the following workaround:
Round(Acos(
Cos(Radians(90-BingMaps.GetLocationByAddress({adminDistrict:Last(Split(TextInputBox.Text, ", ")).Result, locality:First(Split(TextInputBox.Text, ", ")).Result}).point.coordinates.latitude))*Cos(Radians(90-BingMaps.GetLocationByAddress({adminDistrict:Last(Split(ThisItem.'Hometown/State', ", ")).Result, locality:First(Split(ThisItem.'Hometown/State', ", ")).Result}).point.coordinates.latitude))+Sin(Radians(90-BingMaps.GetLocationByAddress({adminDistrict:Last(Split(TextInputBox.Text, ", ")).Result, locality:First(Split(TextInputBox.Text, ", ")).Result}).point.coordinates.latitude))*Sin(Radians(90-BingMaps.GetLocationByAddress({adminDistrict:Last(Split(ThisItem.'Hometown/State', ", ")).Result, locality:First(Split(ThisItem.'Hometown/State', ", ")).Result}).point.coordinates.latitude))*Cos(Radians(BingMaps.GetLocationByAddress({adminDistrict:Last(Split(TextInputBox.Text, ", ")).Result, locality:First(Split(TextInputBox.Text, ", ")).Result}).point.coordinates.longitude-BingMaps.GetLocationByAddress({adminDistrict:Last(Split(ThisItem.'Hometown/State', ", ")).Result, locality:First(Split(ThisItem.'Hometown/State', ", ")).Result}).point.coordinates.latitude))
)*6371,
2)
Best regards,