Forum Discussion

Vmartin002's avatar
Vmartin002
Frequent Visitor
5 years ago
Solved

R-Script Visual Runtime Error in Power BI Server

Hi Everyone,    I wrote a R-Script that works/runs perfectly in Power BI Desktop but doesn't work when published to the Power BI Service. I'm not able to pinpoint the error, is it the pipe operator...
  • Vmartin002's avatar
    Vmartin002
    5 years ago

    Update:

     

    I was able to figure out the issue with the R-Script Visual on the Power BI Service.

     

    The level of factors was fixed by the following edits:

    Orginal:
    prop_df <- df %>% filter(ProjectName == proposal_project) 
    df2df <- df %>% filter(ProjectName != proposal_project)
    New:
    prop_df <- df %>% filter(as.character(ProjectName)== as.character(proposal_project))
    df2df <- df %>% filter(as.character(ProjectName) != as.character(proposal_project))
     
    Also, make sure the package versions are up to date according to https://docs.microsoft.com/en-us/power-bi/connect-data/service-r-packages-support there happened to be unsupported function "group_modify" not supported by the approved dplyr package. Lastly, there seems to be some discrepancies with package versions. To ensure your R-script will run on the power BI service make sure your local machine is running Microsoft R 3.4.4 or R 3.4.4. This is the same R enviroment used on the cloud, so if it runs on your desktop with this version it will run on Power BI service. Also, use install.packages("_____") in your R-Terminal since this will allow package versions that are supported on R 3.4.4. this will help avoid ambiguity.
     
    Best of luck!
    Val