web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Answered

collection issues

(0) ShareShare
ReportReport
Posted on by 297

Hi all, 

 

I have a dropdown of postcodes and in my gallery i have a label with contractor postcodes. I'm using big maps to calculate the distance. The miles are displayed in a label. I would like the gallery to go in ascending distance order......i hope that makes sense. 

 

I have created a collection to collect the mileage in the label and called it Miles

 

In my gallery i have the below code, how do i amend this to sort in ascending order based on the collection?

Filter(Table,postcode = Dropdown3_1.Selected.Result)

 

My Button has this code

Collect(Miles,{Name:CollectMileage})

 

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    on at

    Hi @jsmith87 ,

     

    How do you calculate the distance ? Could you please show me the formula?

     

    Usually, this can be done by adding a distance column to the data source:

     

    Sort(

     AddColumns(

         Filter(Table,postcode = Dropdown3_1.Selected.Result),

         "distance",

         calculate the distance

     ),distance

    )

     

    Best Regards,

    Bof

     

  • jsmith87 Profile Picture
    297 on at

    BingMaps.GetRouteV3("Driving",start1.Text,end1.Text,{distanceUnit:"Mile"}).travelDistance

     

    is the formula i used to work distance 

  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @jsmith87 ,

     

    Please try:

     

    Sort(
    
     AddColumns(
    
     Filter(Table,postcode = Dropdown3_1.Selected.Result),
    
     "distance",
    
     BingMaps.GetRouteV3("Driving",StartColumnName,EndColumnName,{distanceUnit:"Mile"}).travelDistance
    
     ),distance
    
    )

     

    Best Regards,

    Bof

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard