Forum Discussion
Pull custom shape map (topoJSON) keys into table or tooltip?
- 5 years ago
Hi Bonnie,
You can import your custom topojson file as a table and collect the values that way. Then you'll be able to use the key values in your visuals as well.
- go to getdata and choose the json source
- import your topojson file
- the tricky part, you have to navigate to the key information by expanding the records, and turning them into a table (check out a guide here: Using Power BI with JSON Data Sources and Files (mssqltips.com))
- create a relation between the geoid in the new geography table and the county column in the countyresemi table
Once the above steps are done you should have your new geography table ready for use with your other table.
Below you'll find an example of when I import a similar topojson file for Dutch municipalities.
good luck!
- Anonymous5 years ago
ha! got it! I just needed to head into the Relationships area and tell Power BI that these two tables are related by the FIPS code as the key. so a one-to-many relationship (I set cross filter to Both and checked make Active, for anyone else who winds up needing this solution). And ta-da! I was then able to drag County Name from the secondary table (extracted from the JSON as discussed above) into tool tips and Power BI mapped it all out quite nicely. Woo! Thanks everyone!
Hey again Tim!
Ah thank you, that did work for extracting a useful table of FIPS codes + county names...the problem is, I'd love to be able to write a formula or something for each county where if FIPS = 13001 then county_name = Appling, or something to that effect. I'm trying to figure out how to avoid having to add a column to the source data of emissions with county name (as there are 37,000+ and counting lines in there). I guess maybe that formula writing needs to take place earlier in the source data creationg so it's bundled along with every row, rather than doing so at this stage...but thought it was worth exploring Power BI's capabilities!
ha! got it! I just needed to head into the Relationships area and tell Power BI that these two tables are related by the FIPS code as the key. so a one-to-many relationship (I set cross filter to Both and checked make Active, for anyone else who winds up needing this solution). And ta-da! I was then able to drag County Name from the secondary table (extracted from the JSON as discussed above) into tool tips and Power BI mapped it all out quite nicely. Woo! Thanks everyone!
- timg5 years agoSolution Sage
Good to hear it worked out!