cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Partisan
Post Partisan

Error in the R Visual when there is no data for any selected filter

Hi All,

I have a waterfall chart written in R using ggplot2 package. And I am using the R visual present in Power BI. Everything works fine as long as I have data for the selected filter condition. However when I select a value in the slicer , it gives error when there is no data corresponding to the slicer selected. How do we get rid of this error. I want to show custom message like "Selected Filter does not have any data" . Is there any way to do that  ?. Attached error code. 

RuntimeError.JPG

 

 

Regrads,

Akash

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Post Partisan
Post Partisan

Re: Error in the R Visual when there is no data for any selected filter

I was able to resolve this with if else statement. Basically when the dataframe returns 0 record, it gives error. So I have handled this with if else. 

Is dataframe returns 0 then show blank plot else do the actual calcualtion.

 

Regards,

Akash

View solution in original post

2 REPLIES 2
Highlighted
Post Partisan
Post Partisan

Re: Error in the R Visual when there is no data for any selected filter

I was able to resolve this with if else statement. Basically when the dataframe returns 0 record, it gives error. So I have handled this with if else. 

Is dataframe returns 0 then show blank plot else do the actual calcualtion.

 

Regards,

Akash

View solution in original post

Highlighted
Microsoft
Microsoft

Re: Error in the R Visual when there is no data for any selected filter

@akj2784,

Glad to hear that the issue is solved, you can accept your reply as answer to close this  thread.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors