Importing CSV Files From SharePoint Into Power BI
Learn how to connect Power BI to CSV files in a SharePoint folder, find the right site URL, combine estimate files, set permissions and keep refresh working.
Contents
- How Power BI reads CSV files from SharePoint
- Find the correct SharePoint site URL
- Connect from Power BI Desktop step by step
- Filter to the estimate folder and combine files
- Import a single CSV file instead of a folder
- Clean repair estimate columns and data types
- File access permissions and sign-in credentials
- Refresh the published report and fix failures
- SharePoint CSV imports in Power BI
- How do I import a CSV from SharePoint into Power BI?
- Do I need a gateway to refresh CSV files stored in SharePoint?
- Can Power BI combine several CSV files from one SharePoint folder?
- Why does Power BI show no files from my SharePoint site?
- Can I connect to a synced OneDrive folder instead of SharePoint?
- Do new CSV files show up in Power BI after a refresh?
Power BI imports CSV (comma-separated values) files from SharePoint through the SharePoint Online folder connector. In Power BI Desktop, you enter the site URL, or web address, then filter and combine the files. Because the source stays in SharePoint, the report can refresh in the cloud when new files arrive.
- Enter only the site URL, without any library, folder or file path.
- Filter the Folder Path column so the query reads only the folder with your CSV files.
- Combine Files merges every CSV in the folder, so keep columns identical across files.
- Anyone whose account refreshes the report needs read access to the SharePoint library.
- A SharePoint Online source refreshes in the Power BI service without an on-premises data gateway.
How Power BI reads CSV files from SharePoint
Power BI reads SharePoint CSV files by listing every file in a site, then opening chosen ones. The SharePoint Online folder connector returns a table with one row per file. Each row carries the file name, extension, folder path, dates and a binary Content column. Power Query, the data preparation editor inside Power BI, turns that binary content into rows and columns.
A folder connection suits repair estimates that arrive as separate files from different shops. Each new estimate file dropped into the folder joins the dataset at the next refresh. You avoid copying files to a laptop, where links break when someone renames a drive. The shared folder becomes the single place where fleet staff save estimate exports.
A synced local copy of the folder is a weaker source than the SharePoint connection itself. Power BI treats a path on your computer as an on-premises source that needs a gateway. A gateway is a service that lets the cloud reach files on a local machine. Connecting to SharePoint directly keeps refresh in the cloud and ties access to SharePoint permissions.
Find the correct SharePoint site URL
The site URL for the Power BI connector is the root address of the SharePoint site. That root ends with the site name, right after the sites or teams segment of the address. Leave out library names, folder names, file names and anything after a question mark. A longer address can make the connector return an error about an invalid site.
Opening the document library in a browser is a quick way to find the site address. Copy the address up to the site name and delete the rest of the string. For a Microsoft Teams channel, open the channel files in SharePoint to see the underlying site. Every Teams team stores its files in a SharePoint site with its own root address.
Subsites have their own URL, so point the connector at the subsite holding your files. Using the parent site address may leave the subsite libraries out of the file list. Check the address in a browser before pasting it into Power BI Desktop. A page that opens to the site home confirms you have the right root.
Connect from Power BI Desktop step by step
Connecting Power BI Desktop to a SharePoint folder starts from the Get data menu on the Home ribbon. Choose More, open the File group and select SharePoint folder. Paste the site URL into the dialog and confirm with OK. Power BI then asks how you want to sign in to the site.
Sign in with a Microsoft account, the work account your organization uses for SharePoint. Apply the credentials at the site level so other libraries on the site use them too. After sign-in, the Navigator window shows a preview of every file the site holds. Select Transform Data rather than Load, so you can filter before anything reaches the model.
Loading the raw file list without filtering brings in images, documents and spreadsheets beside your CSV files. A large site can also make that first query slow to open. Filtering early in Power Query keeps the steps short and the preview responsive. Your later steps then work only on the estimate files you actually need.
- Open Get data on the Home ribbon and choose More
- Select SharePoint folder in the File group
- Paste the site URL and select OK
- Sign in with your Microsoft work account
- Select Transform Data in the Navigator
- Filter Folder Path and Extension, then combine the files
Filter to the estimate folder and combine files
Filtering on the Folder Path column limits the query to the folder that holds your estimates. Open the column filter, choose Text Filters, then Contains, and enter the folder name. Filter the Extension column to .csv so stray spreadsheets or notes stay out. Extensions can differ in letter case, so lowercase the column or include both spellings.
Combine Files merges every remaining CSV into one table, using a sample file as the pattern. Select the double arrow icon at the top of the Content column to start it. Power BI creates helper queries: a sample file, a transform sample step and a function. Changes made to the Transform Sample File query apply to every file in the folder.
Keeping the Source.Name column after combining shows which file each estimate row came from. That column helps trace a wrong labor charge back to the shop export that contained it. Identical column names and order across files keep the merged table consistent. A file with an extra or renamed column can shift values or drop data.
Import a single CSV file instead of a folder
A single CSV file on SharePoint can be imported with the Web connector instead of the folder connector. In the library, open the file's Details pane and copy its path. Remove any text after a question mark, such as a web view parameter. Paste the result into Get data, Web, and sign in with an organizational account.
The Web connector suits a master estimate file that someone updates in place over time. Power BI reads the same file at each refresh, so renaming or moving it breaks the query. Uploading a replacement with the same name into the same folder keeps the path intact. Version history in SharePoint then holds the earlier copies of that file.
Filtering the folder query down to one file name is another way to reach a single CSV. That method keeps one SharePoint source for all queries, which simplifies credential settings. On a large site, the folder approach can be slower because it lists every file first. Weigh speed against simpler settings when you pick between the two methods.
Clean repair estimate columns and data types
Repair estimate CSV files need correct headers, delimiters and data types before the numbers add up. Check that Power Query promoted the first row to headers in each combined file. Confirm the delimiter in the Source step matches the file, whether comma, semicolon or tab. Set the file origin to UTF-8 when shop names or part descriptions show garbled characters.
Dates in estimate exports follow the regional format of the system that produced them. Use the Using Locale option under Change Type to state the date format of each column. The same option fixes cost columns that use a comma as the decimal separator. Without it, a day and month can swap silently or a cost can load as text.
Automatic Changed Type steps hard-code column names, which breaks refresh when a shop adds a column. Review that step and keep only the columns your report actually uses. Set labor hours, parts cost and totals as decimal numbers so measures sum correctly. Keep vehicle IDs as text, since leading zeros disappear when an ID loads as a number.
File access permissions and sign-in credentials
File access permissions in SharePoint decide whether Power BI can read your CSV files at all. The account used in Power BI Desktop needs at least read access to the library. Without that access, the Navigator shows an empty list or an access error. Ask the site owner to grant access instead of copying files to a folder you control.
Stored credentials for the SharePoint source live in Data source settings in Power BI Desktop. Open File, then Options and settings, then Data source settings to clear or edit them. Clearing them helps after a password change or a sign-in with the wrong account. Power BI asks for credentials again on the next connection attempt.
Privacy levels control how Power Query combines data from different sources in one query. Set the SharePoint source to Organizational when estimate data joins other internal sources. Mismatched privacy levels can block a merge with an error about firewall rules. Your organization's data policy decides the right level, so check it with the report owner.
Refresh the published report and fix failures
Refresh in the Power BI service keeps a published report in step with new estimate files. After publishing, open settings for the semantic model, the dataset behind the report. Under data source credentials, choose OAuth2, a browser-based sign-in, with a work account that can read the library. Then turn on scheduled refresh at times that match when shops send estimates.
Scheduled refresh runs under the stored account, not under each viewer of the report. Refresh stops when that account loses access or leaves the organization. A dedicated service account with read access reduces that risk where your policy allows one. Refresh limits per day depend on your Power BI license and capacity.
Refresh failures after a working setup often trace back to a changed file or folder. A renamed folder breaks a Folder Path filter, while a new column breaks a typed step. The refresh history in the service names the failing query and shows the error text. Fix the source query in Power BI Desktop, then publish the report again.
| Symptom | Likely cause | Fix |
|---|---|---|
| Invalid site address error | URL includes a library or file path | Trim the URL to the site root |
| Empty file list | No read access to the library | Request access from the site owner |
| Garbled characters | Wrong file encoding | Set file origin to UTF-8 |
| Dates swapped or loaded as text | Regional date format differs | Change type using locale |
| Column not found on refresh | Source file columns changed | Edit the Changed Type step |
| Credentials error in the service | Stored sign-in missing or expired | Re-enter OAuth2 credentials |
SharePoint CSV imports in Power BI
How do I import a CSV from SharePoint into Power BI?
You import a SharePoint CSV through Get data, then SharePoint folder, in Power BI Desktop. Enter the site URL, sign in with your work account and select Transform Data. Filter to the CSV file or folder, then combine or open the files in Power Query.
Do I need a gateway to refresh CSV files stored in SharePoint?
No, a gateway is not needed for CSV files stored in SharePoint Online. The Power BI service reaches SharePoint Online directly with the credentials saved in the model settings. A gateway becomes necessary only when the query points to a local or network path.
Can Power BI combine several CSV files from one SharePoint folder?
Yes, Power BI combines several CSV files from one SharePoint folder with the Combine Files command. The files need matching column names and order for the merged rows to line up. Each refresh picks up new files that pass your folder and extension filters.
Why does Power BI show no files from my SharePoint site?
An empty SharePoint file list in Power BI points to a wrong URL or missing permissions. Check that the address stops at the site root and names the correct subsite. Then confirm your account can open the library in a browser.
Can I connect to a synced OneDrive folder instead of SharePoint?
Yes, a synced folder works in Power BI, but refresh in the service then needs a gateway. The gateway machine has to stay on and reach the synced path during each refresh. Connecting to SharePoint directly removes that dependency on a single computer.
Do new CSV files show up in Power BI after a refresh?
Yes, new CSV files in the filtered SharePoint folder load into Power BI at the next refresh. A file outside the filtered folder, or with a different extension, stays out. Files with different columns may load with blanks or cause a refresh error.