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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
miguel1206
Helper II
Helper II

R visualization runs slow

Hi all,

 

I have a pbix file with some R visualizations I have like 10 pages and every time when I change through pages the R programming is loading. 

 
 

When I change through pages always appears loading many seconds 

 

Is there a way to avoid this? like set pre charged visualization and only if I change a filter the r visualization runs 

 

Best regards

1 ACCEPTED SOLUTION
dm-p
Super User
Super User

Hi @miguel1206,

Page changes within a report are treated as a 'data update' event within a visual container and they're all refreshed. This is a bit of a downside of the R and Python visuals.

Each visual is treated as a sandbox and essentially its own runtime environment. As Power BI visual containers are web-based, the data frame + script is sent to the "server" on each visual update for processing - either the specified R instance on your local machine, or the version hosted by the Power BI service if your're hosting up there - and returned back to the client (your visual container).

There is certainly the apperance of a "cold start" while this is going on and can be quite frustrating if you have a lot of visuals on a page or frequently change slicers or cross-filter. It's one of the reasons I moved to custom visuals in TypeScript, as you can structure your code to do most of the processing be done client-side (unless you're specifically sending data over HTTP for processing).

David Eldersveld has a really good post on optimising R and Python scripts within Power BI, or at least as much as can be given the architecture in-place, and explains a lot more about what happens under the hood (much better than I can).

This may not give you exactly what you need but might help you with planning out an alternative approach if you want to stick with R inside Power BI.

Daniel


If my post solves your challenge, then please consider accepting as a solution to help other forum members find the answer more quickly 🙂





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

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




View solution in original post

1 REPLY 1
dm-p
Super User
Super User

Hi @miguel1206,

Page changes within a report are treated as a 'data update' event within a visual container and they're all refreshed. This is a bit of a downside of the R and Python visuals.

Each visual is treated as a sandbox and essentially its own runtime environment. As Power BI visual containers are web-based, the data frame + script is sent to the "server" on each visual update for processing - either the specified R instance on your local machine, or the version hosted by the Power BI service if your're hosting up there - and returned back to the client (your visual container).

There is certainly the apperance of a "cold start" while this is going on and can be quite frustrating if you have a lot of visuals on a page or frequently change slicers or cross-filter. It's one of the reasons I moved to custom visuals in TypeScript, as you can structure your code to do most of the processing be done client-side (unless you're specifically sending data over HTTP for processing).

David Eldersveld has a really good post on optimising R and Python scripts within Power BI, or at least as much as can be given the architecture in-place, and explains a lot more about what happens under the hood (much better than I can).

This may not give you exactly what you need but might help you with planning out an alternative approach if you want to stick with R inside Power BI.

Daniel


If my post solves your challenge, then please consider accepting as a solution to help other forum members find the answer more quickly 🙂





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

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.