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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Microsoft Employee
Microsoft 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
Microsoft Employee
Microsoft 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.