Forum Discussion

DanSanDST's avatar
DanSanDST
Icon for Helper I rankHelper I
1 year ago
Solved

Getting what Name or Id is a point inside multiple Polygons

Greetings, i managed to get an algorithm that calculates if a point (LAT, LONG) is inside a polygon (arranged as an LAT/LONG edges table). It returns True or False, but now i also need whats the name...
  • v-hashadapu's avatar
    v-hashadapu
    1 year ago

    Hi DanSanDST , Thank you for reaching out to the Microsoft Community Forum.

     

    We reproduced your setup and built a DAX calculated column that filters polygons by zone, groups edges by polygon, applies the ray-casting algorithm per group and returns the first polygon that contains the point. If none match, it returns Outside. This gives you exactly what you need, dynamically, without hardcoding.

     

    Please check the attached .pbix file for reference.

     

    That said, this approach won't scale well. DAX has no spatial engine and evaluating every polygon’s edges per point is expensive. For larger datasets, I recommend moving this logic to Power Query or a Fabric notebook, where spatial operations are more efficient and maintainable.