Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Syauqi
Regular Visitor

Data source error: Expression

I face an error below when I do schedule refresh, I already prepared dataset with several elements below and not a single one is missed. But I always face this error.

 

Data source error: Expression.Error: There weren't enough elements in the enumeration to complete the operation.. #table({"Content", "Name", "Extension", "Date accessed", "Date modified", "Date created", "Attributes", "Folder Path", "Category", "Year", "Project Type", "Project Folder Name", "ProjectName", "Brand"}, {}). Microsoft.Data.Mashup.ErrorCode = 10063. Detail = #table({"Content", "Name", "Extension", "Date accessed", "Date modified", "Date created", "Attributes", "Folder Path", "Category", "Year", "Project Type", "Project Folder Name", "ProjectName", "Brand"}, {}). ;There weren't enough elements in the enumeration to complete the operation.. The exception was raised by the IDbCommand interface. Cluster URI: WABI-NORTH-EUROPE-redirect.analysis.windows.net Activity ID: 4b8399d2-bf3f-493e-af1e-752b1fb9e6aa Request ID: 88722c48-abc5-49ff-955a-f211d32ebccc Time: 2025-11-20 09:29:40Z

1 ACCEPTED SOLUTION
Zanqueta
Super User
Super User

Hi @Syauqi,

The error message:
Expression.Error: There weren't enough elements in the enumeration to complete the operation.
indicates that Power Query is attempting to construct a table using #table(...) with a defined set of columns, but the list of rows provided is either empty or incorrectly structured. Even if all column headers are present, Power BI expects each row to contain the same number of elements as there are columns.

 

 

My first suggestion: Try remove this part, after Brand field:  "Brand"}, {}


If dont work:

Recommended Approach

  1. Validate the structure of the row data before constructing the table.
  2. Ensure each row contains the correct number of elements corresponding to the column headers.
  3. Use conditional logic to handle empty or malformed data, for example:

 

let
    rows = {...}, // list of lists containing data
    table = if List.IsEmpty(rows) then
        #table({"Column1", "Column2"}, {})
    else
        #table({"Column1", "Column2"}, rows)
in
    table


Maybe, if you could share part of your M script can be more helpfull.

If this response was helpful in any way, I’d gladly accept a 👍much like the joy of seeing a DAX measure work first time without needing another FILTER.

Please mark it as the correct solution. It helps other community members find their way faster (and saves them from another endless loop 🌀.

If this response was helpful in any way, I’d gladly accept a kudo.
Please mark it as the correct solution. It helps other community members find their way faster.
Connect with me on LinkedIn

View solution in original post

3 REPLIES 3
Zanqueta
Super User
Super User

Hi @Syauqi,

The error message:
Expression.Error: There weren't enough elements in the enumeration to complete the operation.
indicates that Power Query is attempting to construct a table using #table(...) with a defined set of columns, but the list of rows provided is either empty or incorrectly structured. Even if all column headers are present, Power BI expects each row to contain the same number of elements as there are columns.

 

 

My first suggestion: Try remove this part, after Brand field:  "Brand"}, {}


If dont work:

Recommended Approach

  1. Validate the structure of the row data before constructing the table.
  2. Ensure each row contains the correct number of elements corresponding to the column headers.
  3. Use conditional logic to handle empty or malformed data, for example:

 

let
    rows = {...}, // list of lists containing data
    table = if List.IsEmpty(rows) then
        #table({"Column1", "Column2"}, {})
    else
        #table({"Column1", "Column2"}, rows)
in
    table


Maybe, if you could share part of your M script can be more helpfull.

If this response was helpful in any way, I’d gladly accept a 👍much like the joy of seeing a DAX measure work first time without needing another FILTER.

Please mark it as the correct solution. It helps other community members find their way faster (and saves them from another endless loop 🌀.

If this response was helpful in any way, I’d gladly accept a kudo.
Please mark it as the correct solution. It helps other community members find their way faster.
Connect with me on LinkedIn

Hi @Syauqi ,
Thanks for reaching out to the Microsoft fabric community forum. 

 

I would also take a moment to thank  @Zanqueta  , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you .

 

 

Best Regards, 
Community Support Team  

Hi @Syauqi ,
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you .

 

 

Best Regards, 
Community Support Team  

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.