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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 57 | |
| 55 | |
| 42 | |
| 16 | |
| 16 |
| User | Count |
|---|---|
| 113 | |
| 106 | |
| 38 | |
| 35 | |
| 26 |