Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 137 | |
| 102 | |
| 68 | |
| 66 | |
| 64 |