1
votes

Is it possible to read selected value of PBI Slicer from PowerBI and use it in R script(Datasource) to retrieve the results, which generates new datasource.

The thing is column filter works great on data frame generated with R script but what I need is to do calculation based on the selected value of specific column rather then just filtering data.

To simplify , I will put it this way, is it possible to create dynamic Rscript rather than static ones in PowerBI?

2

2 Answers

1
votes

If you want to Read value of PBI Slicer/ Filter and recalculate the Data and Generate Graph accordingly, R Script Visual is the answer.

  • Create R script using loaded columns and filters,
  • Make sure this generates visual, else ERROR.
  • During calculation Generated DF are not loaded in Datasource But can be used to Refresh the Graph.
  • The visual, reads data from filter, runs script generates DF and hence Dynamic graphs.

enter image description here

0
votes

You will probably make more progress by doing as much of the data transformation as possible in the Query Editor UI.

Your requirement sounds like "Add a Custom Column" or "Add a Conditional Column", where you can derive a new column based on values in other columns.