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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
OZMckenzie
Helper I
Helper I

query.Expression.Error.. there weren't enough elements in the enumeration...detail [Table]

Hello,

 

This issue seems has been asked several times in this forum, but I haven't found any solution workable to my question, so I am posting here: 

 

I am creating a function by duplicating one query, and modifiy the query steps by advanced editor. The purpose is to apply the same query steps to another worksheet in another Excel workbook.

 

In the advanced editor, I added "quartername" as the parameter, which is the file name of the Excel workbook. However when I input the name of the workbook and the click "invoke", an error message pops-up as "query. Expression.Error. Snapshot as below. I wonder what caused the error? The details only show [Table] which I don't quite understand.

 

Both workbooks contain several worksheets, but my target sheets are both called "quality data". And the format of both "quality data" are identical. BTW, the file name of the Excel workbook contains Korean character. 

 

Please kindly advise any thoughts or comments, thank you so much!

 

Capture-invoke error message.PNG

Capture-adv editor2.PNG

 

 

 

 

1 ACCEPTED SOLUTION

Hi @OZMckenzie ,

 

Try this on #"Filtered Rows2" step:

(each [Name] = quartername)

 

Instead of string value, use the parameter defined as text,



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

4 REPLIES 4
camargos88
Community Champion
Community Champion

@OZMckenzie ,

 

It looks like you are not using the parameter quartername, only the string "quartername" for the SelectRows function.



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Hi @camargos88 ,

 

Thank you so much for response, may I know how I should fix the function?

Thanks!

Hi @OZMckenzie ,

 

Try this on #"Filtered Rows2" step:

(each [Name] = quartername)

 

Instead of string value, use the parameter defined as text,



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Hi @camargos88 ,

 

It works after I removed the quotation mark, thanks for your great advice!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors