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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Locations in Canvas app
Power Apps
Unanswered

Locations in Canvas app

(0) ShareShare
ReportReport
Posted on by 45

I am working on an app where I have to mark my attendance within a certain radius using that latitude and longitude properties. How to do that ? Please anyone help.

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,781 Most Valuable Professional on at

    Hi @Anony1k ,

    This will get you the distance your current location is from the target location in Kilometers

    With(
     {
     _Lat1: YourTargetLatitude
     _Lat2: Location.Latitude,
     _Long1: YourTargetLongitude
     _Long2: Location.Longitude,
     _Calc: 0.0174532925199432
     },
     12742 * 
     Asin(
     Sqrt(
     0.5 - Cos((_Lat1 - _Lat2) * _Calc)/2 + 
     Cos(_Lat1 * _Calc) * Cos(_Lat2 * _Calc) * 
     (1 - Cos((_Long1 - _Long2) * _Calc)) / 2
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Anony1k Profile Picture
    45 on at

    Where to use this exactly? Can you please explain a bit more.

  • WarrenBelz Profile Picture
    153,781 Most Valuable Professional on at

    @Anony1k ,

    That is the formula to calculate the disance (which is a radius) from where you are located to wherever you want to be measured from (which is what you asked). All you need to do is put in the target location Latitude and Longitude.

    You would use it to show this distance and if applicable compare it with the "certain radius" you mention.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 84

#2
WarrenBelz Profile Picture

WarrenBelz 79 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 40 Super User 2026 Season 1

Last 30 days Overall leaderboard