Forum Discussion
Refresh Error (Service only)
Hey lnedeah ,
This error typically occurs when Power BI tries to construct a table with a defined schema (column headers), but the data (rows) doesn't match specifically, it's expecting 8 fields per row and is getting fewer (or none).
Power BI is using a SharePoint Folder connector where schema detection might fail if the sample file is missing or unreadable.
The folder may contain empty or invalid files that don't provide all the expected fields.
A query may have a hardcoded table structure that doesn’t match the actual data during refresh.
Power BI Desktop uses your local credentials, while the Service uses stored credentials that might lack access.
Try 5 Fixes:
1. Review Your SharePoint Folder Query
Go to the query that uses SharePoint Folder, and look for a step like:
= #table({"Content", "Name", "Extension", "Date accessed", "Date modified", "Date created", "Attributes", "Folder Path"}, {})Make sure it's not trying to create a table with no data. If you see {} there, it's trying to construct a table with no rows.
2. Check Data Source Credentials in Power BI Service
Go to Power BI Service → Settings → Datasets → your dataset → Data source credentials.
Make sure you're using OAuth 2.0 and the connection is valid.
Re-authenticate the SharePoint Folder connection if needed.
3. Validate Files in the Folder
Make sure all files in the SharePoint folder you’re referencing:
Match the expected schema
Are not empty
Are not in a temporary or unsupported format
Also, avoid mixing file types (.xlsx, .csv, .tmp) if you're filtering by extension later in the query.
4. Add Defensive Logic in Power Query
Modify the query that uses #table or the folder to only proceed if files are found:
let
Source = SharePoint.Files("https://yourtenant.sharepoint.com/sites/yourSite", [ApiVersion = 15]),
FilteredFiles = Table.SelectRows(Source, each [Extension] = ".xlsx"),
CheckIfEmpty = if Table.IsEmpty(FilteredFiles) then error "No files found" else FilteredFiles
in
CheckIfEmptyThis avoids passing an empty table into downstream steps, which may trigger that enumeration error.
5. Refresh from Power BI Desktop and Re-Publish
If you've fixed anything in Power Query:
Refresh in Power BI Desktop to confirm it works.
Save and Publish again to Power BI Service.
Schedule a refresh or trigger it manually.
For Detailed Information:
Troubleshoot Power BI Data Refresh
Connect to SharePoint folder in Power BI
Configure scheduled refresh - Power BI
Power Query M error messages
If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.
Best Regards,
Nasif Azam