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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
jruf
Frequent Visitor

Issue filtering an R script

I'm trying to do the following using an R visual in power bi:

  • Build a simple predictive model of a variable over time. The model needs to be built in R.
  • Plot the predictions from the model. Predictions are on the y axis, date is on the x axis.
  • Add a filter for date so that I can filter the plot BUT with the caveat that the predictions are still made using the model fitted on the whole dataset. In other words, adjusting the 'date' filter should change the x axis of the plot, but not the values plotted on the y axis (the predictions).

Is there a way to do this? As far as I can tell whenever I adjust the date filter the whole model is refitted based on the values of the filter. E.g. if the dataset starts at 1/1/2015 and ends at 1/1/2022, if I slide the filter to only plot results between 1/1/2021 and 1/1/2022 the model should still be fitted on the data since 1/1/2015. I havent found a way to do this.

 

Much appreciated

1 REPLY 1
Anonymous
Not applicable

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.