Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hello,
My organization is running a marketing campaign to send a letter to all customers from the location that is closest to them, instead of the location that they first made a purchase at, since that is the location that is connected to the customer in our data structure, and they may be different locations. I have a table of all addresses and longitude/latitude for all customers, and I have another table that has the same information for my organization's locations. How would I go about creating a formula that iterates through all organization locations to find the closest one in distance for each customer? Thank you in advance!
Solved! Go to Solution.
@NJ81858 , for each transaction, make sure you lat log, and you can find min distance with your organization using lat log
You can loop in using a column and maxx/minx function
refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8
@NJ81858 , for each transaction, make sure you lat log, and you can find min distance with your organization using lat log
You can loop in using a column and maxx/minx function
refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 26 | |
| 23 | |
| 19 | |
| 18 | |
| 15 |
| User | Count |
|---|---|
| 46 | |
| 44 | |
| 43 | |
| 36 | |
| 31 |