Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I'm stuck on successfully creating a custom visual using R and Leaflet.
My R code works fine in RStudio, and in PowerBI, I can plot my markers, but I can't figure out how to the the map (addProviderTiles) to render in PowerBI.
Here are the steps I am taking:
1) pbiviz new <visual name> -t rhtml
2) cd <path>\<visual name>
3) npm install leaflet
4) npm install @types/leaflet --save
5) Update the pbiviz.json file for the following fields: email, name, description, gitHubUrl, supportUrl
6) Import/update script.r file
6) run pbiviz package
After importing the visual into PowerBI (see below), it plots the data points with a radius circle, but the map is not rendering. I've tried different provider tiles in my R code, but to no avail.
Can someone point me in the right direction? The tuturials I've found online are dated and following the same steps results in pbiviz package compilation errors.
Good morning, I am trying to create a map with power bi r script, I cannot use shiny and I cannot use leaflet either, can you recommend some option to represent a polygon map from the R script, it has to be interactive?
Thanks for the input, but I tried granting web access to multiple versions of the map url with no luck. I'm starting to think you can't use leaflet through R in PowerBI custom visuals...
Hi @PowerbiGuest23,
I don't have much experience with the R side of things, but have you updated your capabilities.json to include privileges that allow web access? Normally, the visual host will block any external URLs if these are not set. You can usually confirm this by the presence of an error in the developer console in your browser when debugging. If you add in a suitable domain used by Leaflet for the parameters array, this should hopefully work for you.
Hopefully some of this may point you in the right direction 🤞
Daniel
, so I presume that if you enable the domain that leaflet uses for its maps then you
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
6 | |
6 | |
3 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
3 |