r
12 TopicsError package install for R (sf, units)
Hi, I am trying to install sf package in an R notebook in Fabric. 1: In func(...) : installation of package ‘units’ had non-zero exit status 2: In func(...) : installation of package ‘sf’ had non-zero exit status I have tried both add it to the workspace and installing using install.packages in session. The issue is that SF uses the package units as a dependence, and when it tries to install units but it trows an error saying that libudunits2 was not found. Is there a way to add libudunits2 to fabric? -------------------------------------------------------------------------------- Configuration failed because libudunits2.so was not found. Try installing: * deb: libudunits2-dev (Debian, Ubuntu, ...) * rpm: udunits2-devel (Fedora, EPEL, ...) * brew: udunits (OSX) If udunits2 is already installed in a non-standard location, use: --configure-args='--with-udunits2-lib=/usr/local/lib' if the library was not found, and/or: --configure-args='--with-udunits2-include=/usr/include/udunits2' if the header was not found, replacing paths with appropriate values. You can alternatively set UDUNITS2_INCLUDE and UDUNITS2_LIBS manually. Thank you!2KViews0likes0CommentsRolling calculation for previous 12 months
I have a cumulative hours (last 12 months) caculator DAX as follows: Cumulative HOURS = CALCULATE( SUM('Unit'[Hours Worked]), DATESINPERIOD('Unit'[Month], LASTDATE('Unit'[Month]),-12,MONTH )) This will give me the cumulative value for last 12 months, say June 2021 to May 2022. I now want to plot this agaist cumulative of previous 12 months, that is July 2020 - June 2021. How should I modify DAX to get these values. I want both line graphs in the same plot for comparison. How do I go about doing that? Thanks in advance!Solved1.5KViews0likes2CommentsR Visuals on Power BI Report Server
Hello everyone, I'm currently trying to add R Visuals in Power BI Dashboard that will be published on my institutionnal Power BI Report Server. On Power BI Desktop, I use to use - R visuals proposed by Power BI - Custom Visualisation created with R and Plotly that I've created following this tutorial : https://radacad.com/interactive-map-using-r-and-power-bi-create-custom-visual-part-1 Both used to work well in Power BI Desktop. In Power BI Report Server, no visuals are displayed with the current errors: - R Visuals : "The visual elements R are currently disabled in your organization" - Custom Viz. with R : "This visual element cannot be displayed. Try again later or contact support. If you contact support, provide this information." I've also tried with Python visuals with the following error : "Python visuals are only supported in Pwoer BI Desktop" From what I understand, It seems that among this three possibilities, only R visuals are available but I need to enable them at an organizationnal level. Would it be possible to have some help regarding this activation ? Thank you for your help RomainSolved9.4KViews2likes4CommentsR-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 (%<%)? Any help would be highly apperciated, I've been struggling with this issue for some time now. Script Runtime Error: Evaulation Error: Level sets of factors are different R-Script: # 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(ProjectName, Commodity, WBS_code, Months, Running_Total_V2, Total_Scope_V2, RTPercentCompleteV2, Project_Description) # dataset <- unique(dataset) # Paste or type your script code here: library(dplyr) library(ggplot2) library(RColorBrewer) proposal_project <- unique(dataset[["Project_Description"]]) # there are duplicates due to WBS df <- dataset %>% select(ProjectName, Commodity, Months, RTPercentCompleteV2) %>% distinct() # for projects with multiple entries for the same percent complete, keep the highest value df <- df %>% group_by(ProjectName, Commodity, RTPercentCompleteV2) %>% slice(which.max(Months)) %>% arrange(Months) # group by and interpolate pctcomplete <- seq(0.1, 1, by=0.05) df <- df %>% group_by(ProjectName, Commodity) %>% group_modify(~ {approx(.x$RTPercentCompleteV2, .x$Months, xout=pctcomplete) %>% data.frame()}) %>% ungroup() prop_df <- df %>% filter(ProjectName == proposal_project) # split out proposal data after transformations df2df <- df %>% filter(ProjectName != proposal_project) data_wo_proposal <- df2df %>% group_by(Commodity,x) %>% summarise_at(vars(y),list(mean_duration = mean)) # plot mindiff <- min(c(0)) maxdiff <- max(c(max(data_wo_proposal$mean_duration, na.rm=TRUE), max(prop_df$y, na.rm=TRUE))) ticks <- round(seq(mindiff, maxdiff, by=2)) tick_y <- seq(0,100, by=5) g <- ggplot(data=data_wo_proposal, aes(x=mean_duration, y=x, colour=Commodity)) + geom_line(linetype=2) + geom_point() final_plot <- g + geom_line(data = prop_df, aes(x=y,y=x,colour=Commodity)) + geom_point(data=prop_df,aes(x=y,y=x,colour=Commodity)) final_plot_label <- final_plot + labs(title='Average Duration of Reference Projects vs Proposal Project', subtitle=paste('Proposal Project:',prop_df$ProjectName[1], '(solid line in figure below)'), x= 'Duration (Months)',y='Percent Complete') + theme_bw() + theme(legend.position='bottom', legend.title=element_blank()) + scale_colour_brewer(palette='Set1') + scale_x_continuous(breaks=ticks)+scale_y_continuous(labels = scales::percent_format(accuracy = 1),breaks=seq(0,1, by=.05)) final_plot_label Thank you, ValSolvedPower BI - R Script to Get Data - Schedule a Refresh
Hello - I have a Power BI report and I'm using an R query to Get Data. Now I'm trying to schedule a refresh. My Personal Gateway is all set up and I have data sources successfully added to it for other reports that use a SQL Server Data Source Type. Since my source is not excel or a CSV that runs an R Script, and the Source is the R script in itself, how do I add a datasource that corresponds with an R script? Which Data Source Type do I need to add and what are the steps to get this Data Source added so I can schedule a refresh for the data? Thank you.635Views0likes0CommentsUsing R to get data, schedule refresh/add data source
Hello - I have a Power BI report and I'm using an R query to Get Data. Now I'm trying to schedule a refresh. My Personal Gateway is all set up and I have data sources successfully added to it for other reports that use a SQL Server Data Source Type. Since my source is not excel or a CSV that runs an R Script, and the Source is the R script in itself, how do I add a datasource that corresponds with an R script? Which Data Source Type do I need to add and what are the steps to get this Data Source added so I can schedule a refresh for the data? Thank you.721Views1like0CommentsDownloading r scripts on-the-fly
I'm attempting to create a custom visual that downloads r scripts on-the-fly, but am running into a challenge with getting it to work in the Power BI Service. I've created a custom visual based off the RHTML template that is supposed to plot a graph, but I wanted to solve for a solution where our analysts can maintain & tweak their models without having to recompile the Power BI visual. On the desktop, this seems to work wonderfully when I add have the following code in my script.r file and modelpath is a string parameter that is the URL to my file. #Import web file if path is defined if(modelpath != ""){ source(modelpath) } I'm able to post an r script to github and Power BI Desktop (along with R) are able to download and import the file from github. When I attempt to use this same visual with the online Power BI service, I get the following error: In file(filename, "r", encoding = encoding) : InternetOpenUrl failed: 'The server name or address could not be resolved' Please try again later or contact support. If you contact support, please provide these details. Does anyone have any suggestions?740Views0likes0CommentsCustom R Visuals that Work in Report Server
Hi, Since R scripts by default are not able to viewed on an on premises report server is it possible to convert my r script into a pbiviz package which would then be visible on the report server? If not our company would need to look at other softwares since the way we need to visualize the data is not possible in any of the power bi add ins on the store.979Views0likes0Comments