Forum Discussion
Using a custom "map" for Shape Map
- 2 years ago
My solution to find out which sector the shot belongs to. There are many methods to find out if a certain point is in a certain polygon, but all methods do not guarantee the correct result and are very demanding on the computational algorithm. So I chose the "brute force" method:
I gave the artificial intelligence (ChatGPT) an image of the sectors on the board (see initial post above) and instructed it to export the coordinates of each point and the color at that point. For the exported 411,651 points π I changed the color number to the sector number and inserted the resulting table (x, y, id) into the project.
With a simple DAX formula, I can find the sector id for the given x and y coordinates of the shot and that's what I needed. The result is shown in the figure, where the color of the sector is determined by the %FG (percentage of shot success) value from 0 (dark red) to 100 (light green).
My solution to find out which sector the shot belongs to. There are many methods to find out if a certain point is in a certain polygon, but all methods do not guarantee the correct result and are very demanding on the computational algorithm. So I chose the "brute force" method:
I gave the artificial intelligence (ChatGPT) an image of the sectors on the board (see initial post above) and instructed it to export the coordinates of each point and the color at that point. For the exported 411,651 points π I changed the color number to the sector number and inserted the resulting table (x, y, id) into the project.
With a simple DAX formula, I can find the sector id for the given x and y coordinates of the shot and that's what I needed. The result is shown in the figure, where the color of the sector is determined by the %FG (percentage of shot success) value from 0 (dark red) to 100 (light green).