Search code examples
rpowerbipowerbi-desktoppowerbi-custom-visuals

Power BI Time Series Forecasting Chart :: R script error. Loading required package: XML


I want to use Time Series Forecasting Chart.

Reading the Overview I noticed that:

Supports R versions: R 3.3.1, R 3.3.0, MRO 3.3.1, MRO 3.3.0, MRO 3.2.2

enter image description here

Which is OK for me.

So I went online an I downloaded Microsoft R Open 3.2.2. (the only compatible version of MRO I can find online)

But once installed and correctly setup in Power BI Desktop I receive this error:

Feedback Type:
Frown (Error)

Error Message:
R script error.
Loading required package: XML
Loading required package: methods
Loading required package: htmlwidgets
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'htmlwidgets'
2: In libraryRequireInstall("htmlwidgets") :
  *** The package: 'htmlwidgets' was not installed ***
Loading required package: ggplot2
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'ggplot2'
2: In libraryRequireInstall("ggplot2") :
  *** The package: 'ggplot2' was not installed ***
Loading required package: plotly
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'plotly'
2: In libraryRequireInstall("plotly") :
  *** The package: 'plotly' was not installed ***
Loading required package: caTools
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'caTools'
2: In libraryRequireInstall("caTools") :
  *** The package: 'caTools' was not installed ***
Loading required package: scales
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'scales'
2: In libraryRequireInstall("scales") :
  *** The package: 'scales' was not installed ***
Loading required package: forecast
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'forecast'
2: In libraryRequireInstall("forecast") :
  *** The package: 'forecast' was not installed ***
Loading required package: zoo
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'zoo'
2: In libraryRequireInstall("zoo") :
  *** The package: 'zoo' was not installed ***
Loading required package: ggplot2
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'ggplot2'
2: In libraryRequireInstall("ggplot2") :
  *** The package: 'ggplot2' was not installed ***
Error: could not find function "ets"
Execution halted


Stack Trace:
Host:Microsoft.PowerBI.Scripting.R.Exceptions.RScriptRuntimeException
Loading required package: XML
Loading required package: methods
Loading required package: htmlwidgets
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'htmlwidgets'
2: In libraryRequireInstall("htmlwidgets") :
  *** The package: 'htmlwidgets' was not installed ***
Loading required package: ggplot2
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'ggplot2'
2: In libraryRequireInstall("ggplot2") :
  *** The package: 'ggplot2' was not installed ***
Loading required package: plotly
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'plotly'
2: In libraryRequireInstall("plotly") :
  *** The package: 'plotly' was not installed ***
Loading required package: caTools
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'caTools'
2: In libraryRequireInstall("caTools") :
  *** The package: 'caTools' was not installed ***
Loading required package: scales
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'scales'
2: In libraryRequireInstall("scales") :
  *** The package: 'scales' was not installed ***
Loading required package: forecast
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'forecast'
2: In libraryRequireInstall("forecast") :
  *** The package: 'forecast' was not installed ***
Loading required package: zoo
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'zoo'
2: In libraryRequireInstall("zoo") :
  *** The package: 'zoo' was not installed ***
Loading required package: ggplot2
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'ggplot2'
2: In libraryRequireInstall("ggplot2") :
  *** The package: 'ggplot2' was not installed ***
Error: could not find function "ets"
Execution halted

   at Microsoft.PowerBI.Scripting.R.RScriptWrapper.RunScript(String originalScript, Int32 timeoutMs)
   at Microsoft.PowerBI.Client.Windows.R.RScriptHandler.GenerateVisual(ScriptHandlerOptions options)
   --- End of inner exception stack trace ---
   at Microsoft.PowerBI.Client.Windows.R.RScriptHandler.GenerateVisual(ScriptHandlerOptions options)
   at Microsoft.PowerBI.ExploreHost.SemanticQuery.ScriptVisualCommandFlow.RunInternal(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
   at Microsoft.PowerBI.ExploreHost.SemanticQuery.ScriptVisualCommandFlow.Run(Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
   at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.TransformDataShapeResult(QueryCommand transformCommand, SemanticQueryDataShapeCommand command, Stream dataShapeResultStream, QueryBindingDescriptor& bindingDescriptor)
   at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ExecuteDataQuery(IQueryResultDataWriter queryResultDataWriter, EngineDataModel engineDataModel, DataQuery query, Int32 queryId, ServiceErrorStatusCode& serviceErrorStatusCode, CancellationToken cancelToken)
   at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.ProcessAndWriteSemanticQueryCommands(IQueryResultsWriter queryResultsWriter, IList`1 queries, HashSet`1 pendingQueriesToCancel, EngineDataModel engineDataModel)

JavaScript:ShowErrorDialog
 at ErrorHostService.showErrorDialogCore(args)

Stack Trace Message:
R script error.

Invocation Stack Trace:
   at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
   at Microsoft.Mashup.Client.UI.Shared.StackTraceInfo..ctor(String exceptionStackTrace, String invocationStackTrace, String exceptionMessage)
   at Microsoft.PowerBI.Client.Windows.Telemetry.PowerBIUserFeedbackServices.GetStackTraceInfo(Exception e)
   at Microsoft.PowerBI.Client.Windows.Telemetry.PowerBIUserFeedbackServices.ReportException(IWindowHandle activeWindow, IUIHost uiHost, FeedbackPackageInfo feedbackPackageInfo, Exception e, Boolean useGDICapture)
   at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.<>c__DisplayClass14_0.<HandleException>b__0()
   at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.HandleException(Exception e)
   at Microsoft.PowerBI.Client.PowerBIUnexpectedExceptionHandler.HandleException(Exception e)
   at Microsoft.PowerBI.Client.Windows.Utilities.PowerBIFormUnexpectedExceptionHandler.HandleException(Exception e)
   at Microsoft.PowerBI.Client.Windows.ErrorHostService.<>c__DisplayClass6_0.<ShowErrorDialogCore>b__0()
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at System.Windows.Forms.WindowsFormsSynchronizationContext.Send(SendOrPostCallback d, Object state)
   at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.AllowModalDialogs(Action action)
   at Microsoft.PowerBI.Client.Windows.HostServiceDispatcher.<>c__DisplayClass14_0.<ExecuteOnUIThreadAndHandlePromise>b__0()
   at Microsoft.PowerBI.Client.Windows.HostServiceDispatcher.ExecuteOnUIThreadAndHandlePromise[T](Func`1 func, IPromiseStore promiseStore, Int64 promiseHandle)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.PowerBI.Client.Windows.WebView2.WebView2Interop.InvokeCs(InteropCall call)
   at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at Microsoft.Mashup.Client.UI.Shared.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction)
   at Microsoft.PowerBI.Client.Program.<>c__DisplayClass6_0.<RunApplication>b__0()
   at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<>c__DisplayClass3_0.<HandleExceptionsWithNestedTasks>b__0()
   at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
   at Microsoft.PowerBI.Client.Program.RunApplication(String[] args)
   at Microsoft.PowerBI.Client.Program.Main(String[] args)


PowerBINonFatalError:
{"AppName":"PBIDesktop","AppVersion":"2.124.2028.0","ModuleName":null,"Component":"Microsoft.PowerBI.Scripting.R.RScriptWrapper","Error":"Microsoft.PowerBI.Scripting.R.Exceptions.RScriptRuntimeException","MethodDef":"RunScript","ErrorOffset":"","ErrorCode":""}

AS Live Connection:
True

Performance Trace Logs:
C:\Users\FrancescoMantovani\Microsoft\Power BI Desktop Store App\PerformanceTraces.zip

Enabled Preview Features:
PBI_shapeMapVisualEnabled
PBI_qnaLiveConnect
PBI_b2bExternalDatasetSharing
PBI_enhancedTooltips
PBI_sparklines
PBI_scorecardVisual
PBI_NlToDax
PBI_fieldParametersSuperSwitch
PBI_angularRls
PBI_setLabelOnExportPdf
PBI_dynamicFormatString
PBI_oneDriveSave
PBI_oneDriveShare
PBI_newCard
PBI_buttonSlicerAuthoring
PBI_daxQueryView

Disabled Preview Features:
PBI_SpanishLinguisticsEnabled
PBI_onObject
PBI_backstageUI
PBI_useModernPublishDialogs
PBI_gitIntegration
PBI_modelExplorer
PBI_aiNarrativesVisual
PBI_qnaImproveLsdlCopilot

Disabled DirectQuery Options:
TreatHanaAsRelationalSource

Cloud:
GlobalCloud

PowerBIUserFeedbackServices_IsReported:
True

Formulas:


section Section1;

I don't even know where to start to debug here.

The problem is that I have no other version alternative:

  • R 3.3.1 has no .exe install file
  • R 3.3.0 has no .exe install file
  • MRO 3.3.1 cannot be found online
  • MRO 3.3.0 cannot be found online
  • MRO 3.2.2 is the only available online but it give this error.

Solution

  • I contacted Power BI support and the reply was:

    "We investigated your case and this visual is really not been maintained for a long period of time. Since any further development of this visual is not planned and it will not be supported, we will deprecate this visual in a nearest time. We apologize for any inconvenience this situation may have caused you."