Forum Discussion
R script visual not displaying correctly after PowerBI report published
- 2 years ago
Hi Anonymous ,
I think this can be closed now - I found a solution. After installing R 3.4.4, I manually installed all the requirements for tidyverse 1.2.1, after which I could install tidyverse 1.2.1 and use it in PowerBI. Image is now displaying correctly after publishing.
Hi, marta1706
You can visit the following link and download version 4.4.1 to install the tidyverse properly in Rstudio.
Download R-4.4.1 for Windows. The R-project for statistical computing.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi Anonymous ,
Thanks. I know I can do that - it's what resulted in the error message I screenshot in my post. I only tried R 3.4.4 later, because Microsoft say that this is the highest version of R compatible with PowerBI: see here.
Is there anything else I can do? Has anyone else had this problem?
- Anonymous2 years agoNot applicable
Hi, marta1706
Ok, I know it, what R code you used in PBI Desktop, you can share it and we will test to find suitable solutions.
Best Regards,
Yang
Community Support Team- marta17062 years agoRegular Visitor
Hi Anonymous ,
I made a few visuals, here is one example. Like I said, it all works fine in Desktop, and only generates an error after I publish to my workspace.
# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script:# dataset <- data.frame(undefined, undefined.1, undefined.2, undefined.3, undefined.4)# dataset <- unique(dataset)# Paste or type your script code here:library(tidyverse)dataset<-dataset%>%rename(Category=`Supporter Giving category`)%>%rename(Date=`Received Date`)%>%filter(Amount>0)dataset$Date2<-str_sub(dataset$Date, end=10)dataset$Date2<-ymd(dataset$Date2)dataset$count<-1donors_donation_count<-dataset%>%group_by(py3_customer)%>%summarize(count=sum(count))dataset<-left_join(dataset, donors_donation_count, by="py3_customer")%>%rename(count=count.x)%>%rename(donations_per_donor=count.y)dataset$month<-as.character(month(dataset$Date2))dataset<-dataset%>%mutate(month = case_when (month==1 ~"01",month==2 ~"02",month==3 ~"03",month==4 ~"04",month==5 ~"05",month==6 ~"06",month==7 ~"07",month==8 ~"08",month==9 ~"09",month==10 ~"10",month==11 ~"11",month==12 ~"12",.default=NA))dataset$year<-year(dataset$Date2)dataset$year_month<-paste(as.character(dataset$year),"-",dataset$month)dataset2<-dataset%>%filter(donations_per_donor>1)dataset2<-dataset2%>%select(py3_customer, year_month)dataset2<-unique(dataset2)ggplot(dataset2)+aes(x=year_month)+geom_bar(stat="count", fill="#ffb500")+labs(x="Donation month", y="Number of repeat givers", title="Repeat givers per month")+geom_text(aes(label=..count..), stat="count", vjust=1.5, size=6, colour="black", fontface="bold")+theme_light(base_size=25)- Anonymous2 years agoNot applicable
Hi, marta1706
After testing, PBI Service can view visual objects normally. Forgetting a bit about what your data is, you can share pbix files (Google Drive/One Drive) without sensitive data, screenshots, etc. to help us reproduce your problem faster.
Best Regards,
Yang
Community Support Team