Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
rawdata <- list.files(path = "C:/User/Sample/", pattern = "*.csv", full.names = TRUE)%>% lapply(read_csv)%>% bind_rows
Having issue with this script when using R as data source in Power BI. When there are only 2 csv's in the catalogue, script is running fine, however when there are 3 or more csv files, script is stopping and keeps "Evaluating".
I know the workaround is to read all csv's individually, but that is defying the purpose of reading whole folder.
Other solution is to write csv and import do Power BI as data source, but that again is adding an extra step.
Any ideas?
So far my only solutions were to run script in R and then import csv as data source, my other working solution was to use read.csv for each file and then bind_rows
Solved! Go to Solution.
Hi @Kryz82 ,
Please make sure that all files have identical column names, order, and data types first, then update the scripts as below to load the files:
files <- list.files(path = "C:/User/Sample/", pattern = "\\.csv$", full.names = TRUE)
rawdata <- NULL
for (f in files) {
tmp <- read.csv(f, stringsAsFactors = FALSE)
rawdata <- if (is.null(rawdata)) tmp else rbind(rawdata, tmp)
}
Or you can refer the following link to get it:
How can I import multiple csv files into R
Besides that, you can connect to "Folder" connector as an alternative:
How To Load Multiple Files Into Power BI
Import data from a folder with multiple files (Power Query) - Microsoft Support
Import multiple files from multiple folders, and "... - Microsoft Fabric Community
Best Regards
Hi @Kryz82 ,
Please make sure that all files have identical column names, order, and data types first, then update the scripts as below to load the files:
files <- list.files(path = "C:/User/Sample/", pattern = "\\.csv$", full.names = TRUE)
rawdata <- NULL
for (f in files) {
tmp <- read.csv(f, stringsAsFactors = FALSE)
rawdata <- if (is.null(rawdata)) tmp else rbind(rawdata, tmp)
}
Or you can refer the following link to get it:
How can I import multiple csv files into R
Besides that, you can connect to "Folder" connector as an alternative:
How To Load Multiple Files Into Power BI
Import data from a folder with multiple files (Power Query) - Microsoft Support
Import multiple files from multiple folders, and "... - Microsoft Fabric Community
Best Regards
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.