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.
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?
@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
@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.
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
Hi @Hariharan_R on what key can be the relationship between Hospiatls and Regions?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |