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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.