Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
powerbigirl
Frequent Visitor

In which region is a hospital located if I have longitude and latitude for Regions and Hospitals

Hi,

 

I have 2 tables: Regions and Hospitals, and I have lon and lat columns for both of them.

 

I'm trying to add another column that shows in which region a specific hospital is located.

 

Any ideas?

7 REPLIES 7
Anonymous
Not applicable

@powerbigirl , if all you have is a pair of Lat/Long coordinates for both Hospitals and Regions, then you cannot find out which region a hospital is in, as this will require some GIS functionality. But for each hospital's Lat/Long coordinates you can find which region is it nearest to. This article explains how

coordinates - Power BI - Find closest location based on Lat/Lng - Stack Overflow

I'm sorry @Anonymous but it didn't work for me, it gives blanks

Anonymous
Not applicable

@powerbigirl Could you post some sample data of hospitals, regions, and their Lat/Long coordinates please?

Hi @Anonymous  Thank you, I also have the names of the hospitals if that can help.

I will check the link you provided to see if it works.

Hariharan_R
Solution Sage
Solution Sage

Hi,

I hope you have the relationship between the region and hospitals and it is connected with Region (1 side) and Hospitals (Many side). This is my guess. correct me if it is not like that. 

 

In Hospitals table create a calculated column using RELATED DAX function.

 

=RELATED('Region'[Lat])

Same for Lon column

 

Thanks

Hari

Thank you @Hariharan_R  I will try it and let you know

Hi @Hariharan_R  on what key can be the relationship between Hospiatls and Regions? 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.