There may be times when you don’t want to import an entire dataset but a portion of it. You can write an R script to only select specific columns or rows from the entire dataset to be loaded into Power BI.
Datasets can also be imported from files.
click on get data-> Others-> R script->
iris_csv <- read.csv(file="C:/Users/Parul/Desktop/Iris", header=TRUE, sep=",")