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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
MasterP
Helper I
Helper I

R script with filtered dataset

I'm just getting started with R scripting in Power BI. I know that I can create a script visual using any existing field by dragging that field onto the visual, after which it will automatically be loaded into a data frame.

 

My expectation would be that, when the field is filtered at the page or visual level in Power BI, the filtered data set would get loaded to the data frame. In other words, I would expect that the script would respond dynamically to filtering.

 

Is this not the case? It is not working for me, and I cannot tell whether it is user error or just not available.

 

My ultimate goal is to generate a pivot table where I run a simple regression on an increasingly larger data set, and show the "development" of the regression parameter estimates (the rows) over the time frames (the columns). I have seen one person who kindly posted a DAX measure to run simple linear regression, which I suspect would work for this simpler problem. However, I am trying to do this in R because I would like to move on to more complicated analyses, and DAX just isn't built for that.

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

You don't need to limit yourself to add columns to the R script visual. You can add measures too. That should give you the flexibility to dynamically filter your "existing field".

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

You don't need to limit yourself to add columns to the R script visual. You can add measures too. That should give you the flexibility to dynamically filter your "existing field".

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.