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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

0

Drilldown Choropleth Invalid JSON File exception

Hi, I'm trying to use Drilldown Choropleth custom visual but i faced a problem.

First of all idea and chart really usefull If we can use it! (there is no detailed documentation and debug/exception management or real sample)

 

Problem : 

I have 2 TopoJson file for Region and Area levels and this json files works well at the ShapeMap Chart.

But when I try to use same Json files at Drilldown Choropleth or Cartogram it doenst work and shows only "INVALID JSON FILE" exception.

 

 invalid_json_file_exception.png

 

 

 

 

 

 

I already check the demo/sample json files and there is no difference mine json files.

 

What is the problem and how can I fix it?

 

You can find the TopoJson files and sample PBIX file at below to debug and identify the problem.

https://www.dropbox.com/s/z0n24hvgoy952vn/DrilldownChrolepth_Issue.zip?dl=0

Status: Delivered
Comments
v-haibl-msft
Employee

@Anonymous

 

I can repro the same issue as you. I’ve reported it internally to Power BI Team: CRI 47013418
I’ll post here once I get any update about it.

 

Best Regards,
Herbert

Vicky_Song
Impactful Individual
Status changed to: Accepted
 
v-haibl-msft
Employee

@Anonymous

 

Could you please have a try again on your side to see if the fix works now?

 

Best Regards,
Herbert

Anonymous
Not applicable

Hi @v-haibl-msft

 

What did you or hoe did you fix it?

 

Because I deleted the custom visual from PBIX file and ReImprt it from Store and assign the fields ( Sales Amount, Region) but there is no change It is still giving the same exception "INVALID JSON FILE"

Anonymous
Not applicable

Any update on this issue?. I'm having the same issue

Anonymous
Not applicable

If anyone have issue with "Invalid JSON file" error , enable AllowOrigin=* to the root of the website where you are reading this topojson file from. 

If you are using IIS you can add web.config file to your applicaion root.

https://enable-cors.org/server_iis7.html

 

Anonymous
Not applicable

Hi @Anonymous

 

Thanks for your suggestion, 

Adding CORS definitions to web.config file like below Solved the problem.

 

<system.webServer>

    .........

 

  <httpProtocol>
    <customHeaders>
     <add name="Access-Control-Allow-Origin" value="*"/>
     <add name="Access-Control-Allow-Headers" value="Content-Type"/>
     <add name="Access-Control-Allow-Methods" value="POST,GET,OPTIONS"/>
   </customHeaders>
  </httpProtocol>

 

 

v-haibl-msft
Employee

@Anonymous

 

Both Drilldown Choropleth and Cartogram components request TopoJSON files via AJAX calls, PowerBI Custom visuals API accepts AJAX calls via "HTTPS" only and blocks any content served via insecure XMLHttpRequest endpoint.

 

For above scenario files are served over "HTTP". If we tried uploading same topojson file on github and use it - seems to be working fine. 

 

Try this: https://raw.githubusercontent.com/nikhilkabbin/shapefiles/master/custom/area.json

 

Best Regards,
Herbert

Vicky_Song
Impactful Individual
Status changed to: Delivered
 
Overhear
Frequent Visitor

I've also been stumped by the "INVALID JSON FILE" error when creating a drilldown cartogram. I'm using some obscure local geography -- shapefiles for county election districts -- and haven't been able to figure out where to store my layers so that the cartogram viz will accept them.

 

I've tried (and failed) placing them as public hosted layers on ArcGIS Online in shp, json, and topojson formats (for example, here). I don't currently have my own hosting solution where I can configure CORS settings. Do I need one? For instance, my own github repository?

 

@deldersveld, as you're the map hosting and Arcgis-Powerbi integration guru, I'm looping you in here. I'm willing to invest effort and pay a little for hosting if it solves this problem. I'd appreciate any advice.