Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
quantico
New Member

change value of variable dynamically using parameters ( R script)

how can I dynamically change a variable of a R script using the parameters of a template please !!

1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
Employee

Hi @quantico,

 

In Power BI Desktop, we can run R script to import data, create R visual, and prepare your data model in Query Editor. As query parameter is used for retrieving data only currently, you shoud be able to call it when running R script to import data, and prepare your data model in Query Editor, but not to create R visualSmiley Happy

 

In adition, here is a similar thread for your reference. Smiley Happy

let
    Quelle = R.Execute("NormalNoise <- data.frame(x=rnorm(100, mean="&Text.From(Parameter1)&", sd=1))"),
    EnvVars1 = Quelle{[Name="NormalNoise"]}[Value]
in
   EnvVars1

Regards

View solution in original post

1 REPLY 1
v-ljerr-msft
Employee
Employee

Hi @quantico,

 

In Power BI Desktop, we can run R script to import data, create R visual, and prepare your data model in Query Editor. As query parameter is used for retrieving data only currently, you shoud be able to call it when running R script to import data, and prepare your data model in Query Editor, but not to create R visualSmiley Happy

 

In adition, here is a similar thread for your reference. Smiley Happy

let
    Quelle = R.Execute("NormalNoise <- data.frame(x=rnorm(100, mean="&Text.From(Parameter1)&", sd=1))"),
    EnvVars1 = Quelle{[Name="NormalNoise"]}[Value]
in
   EnvVars1

Regards

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.