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).
Hi Petr_Durana ,
TopoJson is a json file that encodes topology for use with shape-mapped visual objects on Power BI.
Any* SVG image can be converted to a TopoJson file using the SVGtoTopoJson.pbix file.
More details can be found at the link:
GitHub - PBIZeroZ/SVGtoTopoJson: Simple SVG to TopoJson converter
To use TopoJSON map files, add the Shape map visual object to the report. In the Format pane, under Map Settings, select Custom Map from the drop-down list, and then select Add Map Type βUnder Map Settings in the Format pane, select Custom Maps from the drop-down list and then select Add Map Type.
For more details, refer to the link:
Use Shape maps in Power BI Desktop (Preview) - Power BI | Microsoft Learn
How To Create Custom Shape Maps for Power BI β DiscoverEI
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Petr_Durana2 years agoFrequent Visitor
Hello,
thanks a lot for the link to SVGtoTopoJson.pbix, it helped me a lot.
I have now created a JSON file that seems to display correctly in Power BI:As I wrote, it has the x and y coordinates of the shots on the paubovce and a success rate of 0/1.
I would need to display in color the total success rate of all shots falling in these sectors in each sector of the "map".
In which properties of the visual should I insert which columns from the table?
Thanks a lot Petr Δ.