Custom visual in Power BI using Python
Asked Answered
R

0

6

I am trying to replicate this for Python, but cannot find any answer:

Is it possible to use R Plotly library in R Script Visual of Power BI?

or :

https://radacad.com/interactive-map-using-r-and-power-bi-create-custom-visual-part-1

Just to be a little more specific: How can I change the offered solution to work with script.py rather than script.R

Any help is highly appreciated.

I have found that in this folder there is a file called capabilities.json, so I assume this is one part of the solution:

  "script": {
      "scriptProviderDefault": "R", ###I guess this needs to be changed to Py
      "scriptOutputType": "html",
      "source": {
        "objectName": "rcv_script",# not sure about this
        "propertyName": "source"
      },
      "provider": {
        "objectName": "rcv_script",# not sure about this
        "propertyName": "provider"
      }
    }

And also after removing referencing dependecies.json in this project, and after building and importing this to Power BI, I got this error

 Error Message:
 An exception of type System.ArgumentException occured.

 Stack Trace:
 System.ArgumentException: The supplied rendering engine is not supported
 at Microsoft.PowerBI.ExploreHost.SemanticQuery.ExecuteSemanticQueryFlow.TransformDat aShapeResult(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)
Ries answered 13/2, 2020 at 18:41 Comment(5)
What part are you stuck on?Spenserian
part 2.2. of the stackoverflow answer. i.e. "script.R is a template that sets up your R script. We're going to edit that later". So if I put script.py there, not sure how the pbivis understands to look for script.py rather than script.R after running this command "pbiviz package"Ries
Did you find a solution?Africa
Unfortunately not, had to do it in RRies
These R packages are supported in Power BI. And these Python libraries are supported. Plotly is not on that list, so yes, you'll have to do it in R.Snort

© 2022 - 2024 — McMap. All rights reserved.