Forum Discussion
Web Pull Error - query. Expression.Error: There weren't enough elements in the enumeration to comple
Hi All,
I have a web data power query that I use to pull a table from multiple URLs. When I build out this table from scratch it populates perfectly fine. However, every time I go to refresh the table as the web data is updated daily, I get the following error, and none of my tables load (pages 1-6 of the URLs):
An error occurred in the ‘’ query. Expression.Error: There weren't enough elements in the enumeration to complete the operation.
Details:
[Table]
The way I've built it is as follows:
1. I have my 6 URLs in a table, under column URL. I use advanced editor with the following to create a function:
(URL) as table =>
let
Source = Web.Page(Web.Contents(URL)),
Data6 = Source{6}[Data],
#"Changed Type" = Table.TransformColumnTypes(Data6,{{"#", Int64.Type}, {"Player", type text}, {"Team", type text}, {"GP", Int64.Type}, {"MPG", type number}, {"PPG", type number}, {"FGM", type number}, {"FGA", type number}, {"FG%", type number}, {"3PM", type number}, {"3PA", type number}, {"3P%", type number}, {"FTM", type number}, {"FTA", type number}, {"FT%", type number}, {"ORB", type number}, {"DRB", type number}, {"RPG", type number}, {"APG", type number}, {"SPG", type number}, {"BPG", type number}, {"TOV", type number}, {"PF", type number}})
in
#"Changed Type"
2. I use this function, to create a new table from the URL table data range. In this table, I add a custom column with the following function:
= #"fx2023-2024 NBA Last 5 Games Stats - Averages"([URL])
This populates the data from all 6 URL into 1 table. On refresh, it populates the error.
But once again, when I delete the table, and build it from the web pull again, it works just fine...Please help!
1 Reply
- AldousPierceIron Contributor
When fixing Power Query formula errors, you have to look at Table.SelectRows or List.Count in the editor to see if these parameters are out of bounds, and it is recommended to add conditional judgments like if List.Count(source) > 0 then.... . else null, to ensure that the enumeration element exists before processing!