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.

Reply
Anonymous
Not applicable

Can I build a map using Leaflet for R and add it to a Power BI Report?

Hello and thanks for reading my question,

 

I like the specific map customization that Leaflet for R provides but need to present my work using Power BI.

Is there a way to render an html file in Power BI?

 

My R code is basic:

 

library(leaflet)
library(htmlwidgets)

 

path <- file.path(getwd(), "test.html")

m <- leaflet() %>% addTiles(urlTemplate = url,
attribution = '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>') %>%
addMarkers(lng = 174.768, lat = -36.852, popup = "Something")

m

saveWidget(m, file = path)

 

I also tried pasting that into the R script visualization with no success. I read about creating a custom visual with nodeJS, but not being an expert, that sounds a bit scary. What are my options?

 

Thanks again!

 

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

AFAIK, power bi desktop has limitations to use R visual and r script so this code may not fully work well when you use on r visual.

You can take a look at the following document to know more about use R script in power bi:

Create Power BI visuals using R#known-limitations 

BTW, of these formulas work on power bi desktop side, you also need to pay attention about use them on power bi service side.
It not as same as executing R script on a local device, r script processing on a cloud server should have more limit and they may be blocked due to performance and security related reasons.

Create visuals by using R packages in the Power BI service 

Power BI Security#data-storage-security 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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