cancel
Showing results for
Did you mean:
New Member

## Identify geographic influence

Hello guys. I'm new here and in PB. I work  for the Brazillian government in the departament of transports. We are developing a project to relate car accidents registered locations with our middle schools locations to act in those schools in order to educate and prevent our children get in these accidents. I have latitude and longitude of many accidents and of all the schools in Brazil but I can't find a way to analyse the accidents in a 100 km radius of the schools to determine the type and the amount of accidents of each type. Can you guys give me some light to solve this  ?

1 ACCEPTED SOLUTION
Community Support

When we want to calculate the distance between two locations, we need to know the coordinates of these two locations.

Here’s the sample data:

We now have the coordinates of current locations and destinations, using below formula we could get the distance between these locations.

``````Distince (KM) =
12742 -- The diameter of the Earth (KM).
* ASIN (
-- Returns the arcsine, or inverse sine, of a number.
SQRT (
-- Returns the square root of a number.
POWER (
-- Returns the result of a number raised to a power.
SIN ( -- Returns the sine of the given angle.
'Table'[Current Lat] - 'Table'[Destination Lat] )
* PI () / 360,
2
) -- PI () Returns the value of Pi, 3.14159265358979, accurate to 15 digits.
+ COS (
-- Returns the cosine of the given angle.
'Table'[Current Lat] * PI () / 180
)
* COS ( 'Table'[Destination Lat] * PI () / 180 )
* POWER (
SIN ( 'Table'[Current Long] - 'Table'[Destination Long] )
* PI () / 360,
2
)
)
)``````

4 REPLIES 4
Community Support

When we want to calculate the distance between two locations, we need to know the coordinates of these two locations.

Here’s the sample data:

We now have the coordinates of current locations and destinations, using below formula we could get the distance between these locations.

``````Distince (KM) =
12742 -- The diameter of the Earth (KM).
* ASIN (
-- Returns the arcsine, or inverse sine, of a number.
SQRT (
-- Returns the square root of a number.
POWER (
-- Returns the result of a number raised to a power.
SIN ( -- Returns the sine of the given angle.
'Table'[Current Lat] - 'Table'[Destination Lat] )
* PI () / 360,
2
) -- PI () Returns the value of Pi, 3.14159265358979, accurate to 15 digits.
+ COS (
-- Returns the cosine of the given angle.
'Table'[Current Lat] * PI () / 180
)
* COS ( 'Table'[Destination Lat] * PI () / 180 )
* POWER (
SIN ( 'Table'[Current Long] - 'Table'[Destination Long] )
* PI () / 360,
2
)
)
)``````

New Member

Thank you for the tip. It worked very well.

Community Champion

Hi

It has the solution to calculate the distance between the locations . Use the latitude & longitude of school & accident location to derive the distance.

Thanks
Raj

New Member

Announcements
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://community.powerbi.com/t5/Desktop/Identify-geographic-influence/m-p/2149546", "fetch_time": 1642823159000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2022-05/segments/1642320303729.69/warc/CC-MAIN-20220122012907-20220122042907-00057.warc.gz", "warc_record_offset": 238476324, "warc_record_length": 99396, "token_count": 718, "char_count": 2896, "score": 3.65625, "int_score": 4, "crawl": "CC-MAIN-2022-05", "snapshot_type": "latest", "language": "en", "language_score": 0.8542870879173279, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00018-of-00064.parquet"}