March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Register NowGet certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
I can find lots of threads where people have this problem, but I can't find one with an actual solution. All I see is people insisting that it works, but it definitely does not work.
When I try to load any custom shape map, such as any of these provided by @deldersveld I get an "Unexpected Error" message. The details say "Failed to execute 'btoa'". In other threads some people can load these files and others can't. @deldersveld says it's a "regional issue" but I don't really know what that means, and I haven't seen anyone offer a way to fix this "regional issue." Does that mean that custom maps just don't work for people who live in certain regions? I find that unbelievable. I am using the latest release of Power BI Desktop, and I am in the United States.
I know shape maps are still technically in preview but surely if it works for some people it should work for everyone. Is there seriously no way to fix this? How do I load a custom shape map? Specifically I need a world map of countries.
Proud to be a Super User!
Solved! Go to Solution.
Ok, I think I might know the potential cause of your issue. When you pulled the file off of GitHub, my guess is that you did not save the actual json file. Instead, you probably right-clicked in the ReadMe and did a Save As on the link to the blob. Is that correct?
GitHub shows a preview of TopoJson, GeoJson, etc. blobs on their own page. Unless you download the entire repo, you need to click through the link and save the Raw json instead of the blob preview.
Post your dataset. Any unicode characters?
@deldersveld It happens with any data set. It even hapens if I type in a random list of countries through Enter Data. Here:
Country | Amount |
Australia | 87 |
Brazil | 12 |
Canada | 3574 |
China | 564 |
France | 254 |
India | 235 |
Italy | 5254 |
Japan | 84 |
Mexico | 4347 |
Russia | 89 |
United States | 135 |
Proud to be a Super User!
Not sure where your issue lies, but I did not run into an issue with my world-countries.json file. Here's a link to the PBIX as well, so check to see if you can open it: https://www.dropbox.com/s/2eii01rb17ixwhy/WorldCountries.pbix?dl=0
I loaded up your 20m US Counties json map into the Power BI drilldown chloropleth map, added the GEOID from the file into my database to correspond with the correct county I wanted, did the same as well for the states, and gave each County/State combination in my access database a unique ID. However, when I try to filter out a specific county in a specific state, the map will populate all of the counties in the US with the same county name even though if is not in the correct state. Do you know a way to only have it display only the county that is in the state that I set a filter for?
Yes I can open it with no trouble. I guess I can only see that it works for other people, but I can't make it work for me. Another worthless new feature I can't use in this damned program.
Proud to be a Super User!
I literally just typed in the stuff in my sample above, set the Country column's data category to Country/Region, and tried to load world-countries.json into the map. Here's the error details:
Feedback Type:
Frown (Error)
Timestamp:
2016-10-24T14:19:49.8800528Z
Local Time:
2016-10-24T10:19:49.8800528-04:00
Product Version:
2.39.4526.362 (PBIDesktop) (x64)
Release:
September 2016
IE Version:
11.321.14393.0
OS Version:
Microsoft Windows NT 10.0.14393.0 (x64 en-US)
CLR Version:
4.6.2. or later [Release Number = 394802]
Workbook Package Info:
1* - en-US, fastCombine: Disabled.
Peak Working Set:
386 MB
Private Memory:
260 MB
Peak Virtual Memory:
33.9 GB
JS Error Message:
Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
Error Message:
An error occurred while rendering the report.
Stack Trace:
Microsoft.Mashup.Host.Document.JavaScriptException: An error occurred while rendering the report.
Error: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
at Error (native)
at saveSliceToDefinition (ms-pbi://pbi.microsoft.com/minerva/scripts/exploreui.js:9328:77)
at Object.saveChangedSliceToDefinition [as save] (ms-pbi://pbi.microsoft.com/minerva/scripts/exploreui.js:9354:25)
at ms-pbi://pbi.microsoft.com/minerva/scripts/exploreui.js:8590:113
at UndoRedoService.register (ms-pbi://pbi.microsoft.com/minerva/scripts/explore.js:6265:159)
at PropertyPaneController.save (ms-pbi://pbi.microsoft.com/minerva/scripts/exploreui.js:8589:93)
at fn (eval at <anonymous> (ms-pbi://pbi.microsoft.com/minerva/scripts/angular.js:1:0), <anonymous>:4:382)
at PropertyCardController.destination.(anonymous function) [as cardChanged] (ms-pbi://pbi.microsoft.com/minerva/scripts/angular.js:9739:22)
at PropertyCardController.sliceChanged (ms-pbi://pbi.microsoft.com/minerva/scripts/exploreui.js:8515:127)
at fn (eval at <anonymous> (ms-pbi://pbi.microsoft.com/minerva/scripts/angular.js:1:0), <anonymous>:4:323)
Invocation Stack Trace:
at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
at Microsoft.Mashup.Client.ClientShared.StackTraceInfo..ctor(String exceptionStackTrace, String invocationStackTrace)
at Microsoft.Mashup.Client.ClientShared.FeedbackErrorInfo..ctor(String message, Nullable`1 errorCode, String requestId, Exception exception)
at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.<>c__DisplayClass1.<HandleException>b__0()
at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.<>c__DisplayClass3.<SendAndMarshalExceptions>b__0(Object null)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at Microsoft.Mashup.Client.ClientShared.WindowManager.ShowDialog[T](T form, IWin32Window owner)
at Microsoft.PowerBI.Client.Program.<>c__DisplayClassb.<Main>b__0()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at Microsoft.PowerBI.Client.Program.Main(String[] args)
User ID:
73a57705-1f23-4e51-9f3a-7208da732c7f
Session ID:
b9b3d5f6-84b2-47d9-b322-55db2026d8e6
Telemetry Enabled:
True
Model Default Mode:
Import
Snapshot Trace Logs:
C:\Users\khorseman\AppData\Local\Microsoft\Power BI Desktop\FrownSnapShot2069757971.zip
Performance Trace Logs:
C:\Users\khorseman\AppData\Local\Microsoft\Power BI Desktop\PerformanceTraces.zip
Enabled Preview Features:
PBI_shapeMapVisualEnabled
PBI_forecastEnabled
Disabled Preview Features:
PBI_RedShift
PBI_Impala
PBI_Snowflake
PBI_allowBiDiCrossFilterInDirectQuery
PBI_esriEnabled
PBI_mobileReportAuthoringEnabled
Disabled DirectQuery Options:
DirectQuery_Unrestricted
Recent Actions:
AddEmptyVisualContainer, AddFieldInRole, VisualContainerPersistProperties, AddFieldInRole, AddVisualContainer, AddFieldToVisual, VisualConversion
Formulas:
section Section1;
shared Table1 = let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("NY3LCsIwFER/Re66G/NodakFoUI3iquQxaUJGAi3kqSgfr154PKcYWaUgge5ZM3unjDZCB3sQXcKpoT+k0kyKaq4BKTFZvMXpy2mgN5hdoehqtsWY+Nj5fHpqKDsW+WKL6QSNzwH/DpfLlnl2b7dsmYWXLTBEQlNWeByaJ2JTH1gXILWPw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Country = _t, Amount = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Country", type text}, {"Amount", Int64.Type}})
in
#"Changed Type";
Active Section Contract:
{"id":0,"name":"ReportSection","displayName":"Page 1","ordinal":0,"visualContainers":[{"x":10,"y":20,"z":1,"width":280,"height":280,"config":"{\"layouts\":[{\"id\":0,\"position\":{\"x\":10,\"y\":20,\"width\":280,\"height\":280,\"z\":1}}],\"singleVisual\":{\"visualType\":\"shapeMap\",\"projections\":{\"Category\":[{\"queryRef\":\"Table1.Country\"}],\"Value\":[{\"queryRef\":\"Sum(Table1.Amount)\"}]},\"prototypeQuery\":{\"Version\":2,\"From\":[{\"Name\":\"t\",\"Entity\":\"Table1\"}],\"Select\":[{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"t\"}},\"Property\":\"Country\"},\"Name\":\"Table1.Country\"},{\"Aggregation\":{\"Expression\":{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"t\"}},\"Property\":\"Amount\"}},\"Function\":0},\"Name\":\"Sum(Table1.Amount)\"}]},\"objects\":{\"shape\":[{\"properties\":{\"map\":{\"geoJson\":{\"type\":{\"expr\":{\"Literal\":{\"Value\":\"'shared'\"}}},\"name\":{\"expr\":{\"Literal\":{\"Value\":\"'usa.states.topo'\"}}},\"content\":{\"expr\":{\"ResourcePackageItem\":{\"PackageName\":\"ShapeMap\",\"PackageType\":2,\"ItemName\":\"usa.states.topo\"}}}}},\"projectionEnum\":{\"expr\":{\"Literal\":{\"Value\":\"'albersUsa'\"}}}}}],\"dataPoint\":[{\"properties\":{\"fillRule\":{\"linearGradient2\":{\"max\":{\"color\":{\"expr\":{\"Literal\":{\"Value\":\"'#01B8AA'\"}}}},\"min\":{\"color\":{\"expr\":{\"Literal\":{\"Value\":\"'#ccf1ee'\"}}}}}}}}]}},\"name\":\"VisualContainer\"}"},{"x":441.875759416768,"y":107.2053462940462,"z":2,"width":300,"height":300,"config":"{\"layouts\":[{\"id\":0,\"position\":{\"x\":441.875759416768,\"y\":107.2053462940462,\"width\":300,\"height\":300,\"z\":2}}],\"singleVisual\":{\"visualType\":\"table\",\"projections\":{\"Values\":[{\"queryRef\":\"Table1.Country\"},{\"queryRef\":\"Sum(Table1.Amount)\"}]},\"prototypeQuery\":{\"Version\":2,\"From\":[{\"Name\":\"t\",\"Entity\":\"Table1\"}],\"Select\":[{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"t\"}},\"Property\":\"Country\"},\"Name\":\"Table1.Country\"},{\"Aggregation\":{\"Expression\":{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"t\"}},\"Property\":\"Amount\"}},\"Function\":0},\"Name\":\"Sum(Table1.Amount)\"}]}},\"name\":\"VisualContainer1\"}"}],"displayOption":1,"width":1280,"height":720,"config":"{}"}
Proud to be a Super User!
@deldersveld I'm encountering the same issue as @KHorseman (btw I can also open your pbix file and it works fine)
However when I try to use any of your TopoJSON files I get that Error => Here's what I'm doing...
Yep, @Sean could just as well have been taking screenshots off my computer. Identical to what I'm doing.
Proud to be a Super User!
Ok, I think I might know the potential cause of your issue. When you pulled the file off of GitHub, my guess is that you did not save the actual json file. Instead, you probably right-clicked in the ReadMe and did a Save As on the link to the blob. Is that correct?
GitHub shows a preview of TopoJson, GeoJson, etc. blobs on their own page. Unless you download the entire repo, you need to click through the link and save the Raw json instead of the blob preview.
@deldersveld yep that was it. Thanks. I assumed that a URL that ended in a file name with a file extension was a link to the actual file with that name and extension. Silly me. Apparently github is different from the entire rest of the internet.
Proud to be a Super User!
@deldersveld Thanks!
As @KHorseman said it really looks like you are saving the right file.
Next I'll have to give QGIS a try because I'm having to luck with mapshaper converting other GeoJSON files into usable in PBI TopoJSON files. Thanks!
@deldersveld I have a question about your us-albers.counties.json file?
I can't figure out how to plot the correct county in the correct state?
Here is some sample data
These are the 3 most popular county names
(btw these are not all their occurences - I kind of narrowed them down to just the SE/4 of the country)
County Column | Full State Name | Population | County Name | County, State | County Word |
Jefferson County | Alabama | 659,479 | Jefferson | Jefferson County, Alabama | County |
Washington County | Alabama | 16,877 | Washington | Washington County, Alabama | County |
Jefferson County | Arkansas | 73,191 | Jefferson | Jefferson County, Arkansas | County |
Lincoln County | Arkansas | 14,031 | Lincoln | Lincoln County, Arkansas | County |
Washington County | Arkansas | 216,410 | Washington | Washington County, Arkansas | County |
Jefferson County | Florida | 14,194 | Jefferson | Jefferson County, Florida | County |
Washington County | Florida | 24,624 | Washington | Washington County, Florida | County |
Jefferson County | Georgia | 16,320 | Jefferson | Jefferson County, Georgia | County |
Lincoln County | Georgia | 7,751 | Lincoln | Lincoln County, Georgia | County |
Washington County | Georgia | 20,676 | Washington | Washington County, Georgia | County |
Jefferson County | Indiana | 32,458 | Jefferson | Jefferson County, Indiana | County |
Washington County | Indiana | 27,780 | Washington | Washington County, Indiana | County |
Jefferson County | Kansas | 18,813 | Jefferson | Jefferson County, Kansas | County |
Lincoln County | Kansas | 3,147 | Lincoln | Lincoln County, Kansas | County |
Washington County | Kansas | 5,629 | Washington | Washington County, Kansas | County |
Jefferson County | Kentucky | 756,832 | Jefferson | Jefferson County, Kentucky | County |
Lincoln County | Kentucky | 24,370 | Lincoln | Lincoln County, Kentucky | County |
Washington County | Kentucky | 11,875 | Washington | Washington County, Kentucky | County |
Jefferson County | Mississippi | 7,629 | Jefferson | Jefferson County, Mississippi | County |
Lincoln County | Mississippi | 34,810 | Lincoln | Lincoln County, Mississippi | County |
Washington County | Mississippi | 49,688 | Washington | Washington County, Mississippi | County |
Jefferson County | Missouri | 221,396 | Jefferson | Jefferson County, Missouri | County |
Lincoln County | Missouri | 53,860 | Lincoln | Lincoln County, Missouri | County |
Washington County | Missouri | 25,172 | Washington | Washington County, Missouri | County |
Lincoln County | North Carolina | 79,740 | Lincoln | Lincoln County, North Carolina | County |
Washington County | North Carolina | 12,722 | Washington | Washington County, North Carolina | County |
Jefferson County | Oklahoma | 6,432 | Jefferson | Jefferson County, Oklahoma | County |
Lincoln County | Oklahoma | 34,351 | Lincoln | Lincoln County, Oklahoma | County |
Washington County | Oklahoma | 51,577 | Washington | Washington County, Oklahoma | County |
Jefferson County | Tennessee | 52,123 | Jefferson | Jefferson County, Tennessee | County |
Lincoln County | Tennessee | 33,633 | Lincoln | Lincoln County, Tennessee | County |
Washington County | Tennessee | 125,546 | Washington | Washington County, Tennessee | County |
Jefferson County | Texas | 252,358 | Jefferson | Jefferson County, Texas | County |
Washington County | Texas | 34,147 | Washington | Washington County, Texas | County |
Washington County | Virginia | 54,907 | Washington | Washington County, Virginia | County |
Jefferson County | West Virginia | 55,073 | Jefferson | Jefferson County, West Virginia | County |
Lincoln County | West Virginia | 21,559 | Lincoln | Lincoln County, West Virginia | County |
In both PBI's regular and filled maps and in the ArcGIS visual you basically use the County, State field and you get this result...
(Note that if you don't use this field you'll get incorrect results!)
Now when we go to the topojson file - it would not plot anything using the County, State field
If i use only the County it plot like this - it plots Counties with the same name but in states which are not even included
Any advice will be much appreciated!
Thanks in advance!
I would try using a column that concatenates the county and state, e.g. "Hamilton County, OH" rather than the raw county name.
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Check out the November 2024 Power BI update to learn about new features.
User | Count |
---|---|
116 | |
88 | |
78 | |
65 | |
59 |
User | Count |
---|---|
140 | |
122 | |
105 | |
94 | |
90 |