Forum Discussion
SilentKernel
4 months agoFrequent Visitor
Display Stores Within Radius for Multiple ZIP Codes
Hi everyone, I am working on a Power BI report using Azure Maps. I have a STORE table that contains: Store name Address Latitude Longitude I also have a ZIPCODE table that contains all vali...
SilentKernel
4 months agoFrequent Visitor
I’ve already used the Haversine formula to calculate the distance between a single coordinate and a set of stores and I can successfully display all stores within a given radius r. However, I’m struggling to extend this logic to handle multiple user‑entered ZIP codes.
My goal is to identify all potential stores located within a radius r of each user‑provided ZIP code.
How can I efficiently compute this for multiple ZIP code inputs?
lbendlin
4 months agoSuper User
You create a CROSSJOIN between the stores and the ZIP codes, and then calculate the Haversine for each of the items in the cartesian product. You can also use GENERATE for the same purpose.
You will want to limit that to the filter context (for example what is visible on the map) to avoid computational overload.