0

I can not see how to interact with the powerBI dataset. I'm using a simple chart. I can run using Rstudio but I can't run the same code using R visual in powerBI.

QCData <- cbind(QC_xts)

dygraph(QCData,ylab="Timestamp", main="´Quality Control") %>%
 # dySeries("QC_xts",label="XS") %>%
  # dySeries("..2",label="LNKD") %>%
  dyOptions(colors = "blue") %>%
  dyRangeSelector()

My cod is working in R studio

QCData <- cbind(QC_xts)

dygraph(QCData,ylab="Timestamp", main="´Quality Control") %>%
 # dySeries("QC_xts",label="XS") %>%
  # dySeries("..2",label="LNKD") %>%
  dyOptions(colors = "blue") %>%
  dyRangeSelector()

The erro is not display any chart. PBI show this error: An exception of type Microsoft.PowerBI.ExploreServiceCommon.ContainPIIException occured.

  • Welcome to SO! Please provide a [reproducible minimal example](https://stackoverflow.com/q/5963269/8107362) – mnist Oct 31 '19 at 22:27

2 Answers2

0

I've just had the same issue in PowerBI and resolved it by simply adding in library(ggalt) at the start of my script. In Rstudio I had accidentally removed that line but it was still working as the library had already been loaded. When copying the code over to PowerBI you have to declare all the libraries at the start of the script, as unlike RStudio it doesn't "remember" what was initially loaded.

I'm no R expert at all but I was literally searching google for the same issue you had and fortunately figured out a solution that I hope you can use too. In your case it might not be library(ggalt) but could be some other library you didn't declare

Gangrel
  • 449
  • 4
  • 20
0

I got the problem in here. The code bellow works fine. The problem was editing pbiviz.json in the supportUrl and gitHubUrl must be HTTPS. I missed the "s" in the end and it seems that was the problem.

  source('./r_files/flatten_HTML.r')
  ############### Library Declarations ###############
  libraryRequireInstall("ggplot2");
  libraryRequireInstall("plotly")
  ####################################################
  ################### Actual code ####################
  p <- plot_ly(x = Values$Timestamp, y = Values$Eth, type='scatter', mode = 'lines');
  ####################################################
  ############# Create and save widget ###############
  internalSaveWidget(p, 'out.html');
  ####################################################