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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mscno
Regular Visitor

Scheduled refresh from Exchange fails:"Not enough elements in the enumeration to complete operation"

Hi everyone,

 

This is my first post on the forums.

 

I have created a query that sources Exchange data. More precisely the query goes into Exchange finds a particular email and opens the attachment as an excel workbook.

The query works fine in Power BI Desktop, but the scheduled refresh fails online with the message: "There weren't enough elements in the enumeration to complete the operation".

 

Capture2.PNG

 

The first part of my query enters into my mailbox and finds a particular email and opens the attachment:

 

Summary of the Query Code:

Name: File_Fetch (2)

let
Source = Exchange.Contents("[EDITED]"),
Mail1 = Source{[Name="Mail"]}[Data],
#"Filtered Rows" = Table.SelectRows(Mail1, each ([Folder Path] = "[ACTUAL PATH]")),
#"Sorted Rows" = Table.Sort(#"Filtered Rows",{{"DateTimeReceived", Order.Descending}}),
#"Kept First Rows" = Table.FirstN(#"Sorted Rows",1),
#"Removed Other Columns" = Table.SelectColumns(#"Kept First Rows",{"Attachments"}),
#"Expanded Attachments" = Table.ExpandTableColumn(#"Removed Other Columns", "Attachments", {"AttachmentContent"}, {"Attachments.AttachmentContent"}),
Navigation1 = #"Expanded Attachments"{0}[Attachments.AttachmentContent]
in
Navigation1

 

This file attachment is then saved as a binary parameter :

Name: File_Name (2)

#"File_Fetch (2)" meta [IsParameterQuery=true, BinaryIdentifier=#"File_Fetch (2)", Type="Binary", IsParameterQueryRequired=true]

 

This parameter is then used as a soure to open the actual tables located inside the excel:

let
Source = Excel.Workbook(#"File_Name (2)", null, true),
API = Source{[Name="API"]}[Data],
#"Changed Type1" = Table.TransformColumnTypes(API,{{"Column1", type number}}),
#"Changed Type" = Table.TransformColumnTypes(#"Changed Type1",{{"Column1", type number}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "API"}}),
#"Added Index" = Table.AddIndexColumn(#"Renamed Columns", "Index", 0, 1),
#"Reordered Columns" = Table.ReorderColumns(#"Added Index",{"Index", "API"})
in
#"Reordered Columns"

 

 

The query works perfectly on my when querying it in Power BI Desktop, but the refresh does not work online. I have entered the credentials correct online, so this is not the issue.

 

Anyone who have experienced similar issues, or have an idea what causes the scheduled refresh to fail?

1 REPLY 1
v-yuezhe-msft
Employee
Employee

 

@mscno ,

The above error message mentions API2 table,  I haven’t seen the query code about API2, are you able to refresh the API2 table in Power BI Desktop?

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors