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
moralesm7
New Member

How to get a secondary location/distance

Hello,

 

Here is what I am trying to solve:

I have a table with Business addresses (business Zip) and a Table with People and their home zips + their assigned business ZIP.

 

I am trying to figure out the distance between each person and each location. I was able to get each person to their assigned location, and each person to locations within the state they reside in (if any) by joining bot tables as a new one and expanding.

 

I still need to get each to every other zip code (outside of assigned state).

 

After i manage this part, I also need to assign a secondary location to each person based on the second closes distance between home zip/business zip.

 

I am having a hard time explanding to all US business zips and I cannot figure a formula to get the second closest location (could not get RANKX to work for this, too many distances), plus if possible i would like to get which location that is that i am getting in the secondary distance.

 

Any suggestions/helps greatly appreciated!

 

Manuela

1 REPLY 1
lbendlin
Super User
Super User

Does your data come with latitude and longitude of the center of each ZIP code? Do you want to use the Great Circle Distance or a simpler approximation?

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.