Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
amarcos
Regular Visitor

shape map

 

i want to use some countries shape maps that are not in Power BI, for example Finland, i downloaded the GeoJSON file from here

http://code.highcharts.com/mapdata/

Finland http://code.highcharts.com/mapdata/countries/fi/fi-all.geo.json

Then I opened in http://mapshaper.org/ and exported as TopoJSON

When i open it in Power IB I can not see the map only linesCapturar 2016-09-21 01_36_30.png

Can you help me?

 

I just need TopoJson files from

Regiosn in Finland

Communitues in Spain

Regions in Norway

Regions in Sweden

Thanks

 

16 REPLIES 16

@amarcos This blog by @deldersveld will probably help you resolve the issue.


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

Thanks a lot

I already looked at this, but I couldnt find a solution

 

Thanks @Seth_C_Bauer. I've also added Finland to my TopoJSON repository: https://github.com/deldersveld/topojson

Thanks a lot

I dowloaded finland-regions.json

but when I add this to power BI it gives me an unexpected error. Capturar 2016-09-21 04_45_58.pngWhy could be this?

 

Are you running the August 2016 version 2.38.4491.282? If so, can you post the text of the error detail? An earlier version of the Shape Map could not handle unicode characters and would give an error mentioning "btoa" conversion somewhere in the text. I tested it in the aforementioned version, and the regions map displays for me.

 

FinlandRegions.PNG

 

 

 

 

@deldersveld I'm using version 2.38.4491.282 64-bit (August, 2016)

 

And this is the 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:7606:77)
at Object.saveChangedSliceToDefinition [as save] (ms-pbi://pbi.microsoft.com/minerva/scripts/exploreui.js:7632:25)
at ms-pbi://pbi.microsoft.com/minerva/scripts/exploreui.js:6874:113
at UndoRedoService.register (ms-pbi://pbi.microsoft.com/minerva/scripts/explore.js:6000:159)
at PropertyPaneController.save (ms-pbi://pbi.microsoft.com/minerva/scripts/exploreui.js:6873: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:6799:26)
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.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)


JS Error Message
Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.

Recent Actions
SavePropertyPane, SavePropertyPane, VisualContainerUpdateDimensions, VisualContainerUpdateDimensions, VisualContainerUpdateDimensions, VisualContainerUpdateDimensions, VisualContainerUpdateDimensions, VisualContainerUpdateDimensions, VisualContainerUpdateDimensions, VisualContainerUpdateDimensions, VisualContainerUpdateDimensions, SavePropertyPane, SavePropertyPane, SavePropertyPane, SavePropertyPane

Active Section Contract
{"name":"ReportSection3","displayName":"Finland","ordinal":3,"visualContainers":[{"x":0,"y":89.32593180015861,"z":1,"width":421.25297383029346,"height":297.4147501982554,"config":"{\"layouts\":[{\"id\":0,\"position\":{\"x\":0,\"y\":89.32593180015861,\"z\":1,\"width\":421.25297383029346,\"height\":297.4147501982554}}],\"singleVisual\":{\"visualType\":\"barChart\",\"projections\":{\"Category\":[{\"queryRef\":\"Finland.State / Province\",\"active\":true}],\"Y\":[{\"queryRef\":\"Sum(Finland.SEEs)\"}]},\"prototypeQuery\":{\"Version\":2,\"From\":[{\"Name\":\"f\",\"Entity\":\"Finland\"}],\"Select\":[{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"f\"}},\"Property\":\"State / Province\"},\"Name\":\"Finland.State / Province\"},{\"Aggregation\":{\"Expression\":{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"f\"}},\"Property\":\"SEEs\"}},\"Function\":0},\"Name\":\"Sum(Finland.SEEs)\"}]}},\"name\":\"VisualContainer\"}"},{"x":0,"y":414.4647105471848,"z":2,"width":367.45440126883426,"height":303.50515463917526,"config":"{\"layouts\":[{\"id\":0,\"position\":{\"x\":0,\"y\":414.4647105471848,\"z\":2,\"width\":367.45440126883426,\"height\":303.50515463917526}}],\"singleVisual\":{\"visualType\":\"filledMap\",\"projections\":{\"Category\":[{\"queryRef\":\"Finland.State / Province\",\"active\":true}],\"Size\":[{\"queryRef\":\"Sum(Finland.SEEs)\"}],\"Series\":[{\"queryRef\":\"Finland.code\"}]},\"prototypeQuery\":{\"Version\":2,\"From\":[{\"Name\":\"f\",\"Entity\":\"Finland\"}],\"Select\":[{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"f\"}},\"Property\":\"State / Province\"},\"Name\":\"Finland.State / Province\"},{\"Aggregation\":{\"Expression\":{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"f\"}},\"Property\":\"SEEs\"}},\"Function\":0},\"Name\":\"Sum(Finland.SEEs)\"},{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"f\"}},\"Property\":\"code\"},\"Name\":\"Finland.code\"}]},\"objects\":{\"dataPoint\":[{\"properties\":{\"fillRule\":{\"linearGradient2\":{\"max\":{\"color\":{\"expr\":{\"Literal\":{\"Value\":\"'#01B8AA'\"}}}},\"min\":{\"color\":{\"expr\":{\"Literal\":{\"Value\":\"'#ccf1ee'\"}}}}}}}}]}},\"name\":\"VisualContainer1\"}"},{"x":412.1173671689136,"y":46.693100713719275,"z":3,"width":812.0539254559874,"height":647.6130055511499,"config":"{\"layouts\":[{\"id\":0,\"position\":{\"x\":412.1173671689136,\"y\":46.693100713719275,\"z\":3,\"width\":812.0539254559874,\"height\":647.6130055511499}}],\"singleVisual\":{\"visualType\":\"shapeMap\",\"projections\":{\"Value\":[{\"queryRef\":\"Sum(Finland.SEEs)\"}],\"Category\":[{\"queryRef\":\"Finland.code\"}]},\"prototypeQuery\":{\"Version\":2,\"From\":[{\"Name\":\"f\",\"Entity\":\"Finland\"}],\"Select\":[{\"Aggregation\":{\"Expression\":{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"f\"}},\"Property\":\"SEEs\"}},\"Function\":0},\"Name\":\"Sum(Finland.SEEs)\"},{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"f\"}},\"Property\":\"code\"},\"Name\":\"Finland.code\"}]},\"objects\":{\"dataPoint\":[{\"properties\":{\"fillRule\":{\"linearGradient2\":{\"max\":{\"color\":{\"expr\":{\"Literal\":{\"Value\":\"'#01B8AA'\"}}}},\"min\":{\"color\":{\"expr\":{\"Literal\":{\"Value\":\"'#ccf1ee'\"}}}}}}}}],\"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'\"}}}}}]}},\"name\":\"VisualContainer2\"}","popOutMode":0}],"displayOption":1,"width":1280,"height":720,"config":"{}"}

 

Can you post a PBIX or a dataset? I see the "btoa" encoding error in your message.

Thanks. I wonder if this is perhaps a regional Windows setting. I was able to open your file and use the finland-regions.json file with your data. I've uploaded the PBIX from which I took the screenshot below. What happens if you open it on your computer?

https://www.dropbox.com/s/wyclqwjo8dh2z0d/Finland.pbix?dl=0

 

Finland.PNG

 

 

It works!!!

I can see it now

Wow great thanks a lot!!!

Is there a way that I can just copy this into another power BI project?

 

I´m going to need the same for Norway, Sweden and Spain

Could it be possible if I sent you the ones that I have and you also help me?

Thanks a lot 

Ainhoa

Hi @amarcos,

 

Copy items from one Power BI project to another project is not supported in current version of Power BI desktop.

 

If you have any concern on this feature, you can submit your idea on the link below. If this feature was mentioned by mulitple users, product team will consider to add this feature to next release.
https://ideas.powerbi.com/forums/265200-power-bi-ideas

Regards,

Charlie Liao

@deldersveld I'm getting the same "unexpected error" that says "failed to execute 'btoa'" whenever I try to use any of your map files. I'm running the September 2016 release. How do I fix this?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Sean
Community Champion
Community Champion

@deldersveld same here Smiley Sad I also tried several of your map files but I'm getting the same error as @KHorseman

 

I'm also running the latest PBI.

As mentioned earlier in this thread, it could be a regional issue. It's not an issue with the files.

@deldersveld Regional as in my location? Do these maps not work for users in the United States? Is there a way to fix this regional issue? Or does someone know where I can find a world map file that does work for users in my region? I just need a map that works.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




As mentioned earlier in this thread, it could be a regional issue. It's not an issue with the files.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.