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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
PowerDAX
Resolver III
Resolver III

Direct Query - Collection was modified; enumeration operation may not execute

Continuously run into this error with a data model built using Direct Query to a SQL on-premises database.  This occurs after saving pbix file and opening the next day.  I have had to try converting to zip and replacing the guts of a blank pbix with that of the "broken" direct query pbix but was unsuccessful with the last two.  I am now having to restore a backup from onedrive and lose any changes made since.

 

Full error message:

 

Feedback Type:
Frown (Error)

Error Message:
Collection was modified; enumeration operation may not execute.

Stack Trace:
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at Microsoft.Mashup.Host.Document.FormulaRegistry.<GetBuiltInFormulas>d__0.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at Microsoft.Mashup.Host.Document.FormulaSet.FilteredFormulaSet.<GetFormulas>d__8.MoveNext()
at Microsoft.Mashup.Host.Document.FormulaRegistry.<GetPotentialFormulasCore>d__11.MoveNext()
at Microsoft.Mashup.Host.Document.FormulaRegistry.<GetPotentialFormulas>d__b.MoveNext()
at Microsoft.Mashup.Host.Document.FormulaRegistry.TryGetFormula(FormulaSet formulaSet, FormulaReference formulaReference, FormulaResult baseResult, Formula& formula)
at Microsoft.Mashup.Host.Document.FormulaRegistry.GetFormula(FormulaSet formulaSet, FormulaReference formulaReference, FormulaResult baseResult)
at Microsoft.Mashup.Client.UI.Shared.QueryExtensions.<>c__DisplayClass14.<SupportsCubeDirectQuery>b__13(PackageEditor packageEditor)
at Microsoft.Mashup.Host.Document.Model.Queries.InvokeWithPackageEditor[T](Nullable`1 changeReason, Func`2 action)
at Microsoft.Mashup.Client.UI.Shared.QueryExtensions.SupportsCubeDirectQuery(Query query)
at Microsoft.Mashup.Client.UI.Shared.QueryExtensions.IsCubeDirectQuery(Query query)
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
at Microsoft.PowerBI.Client.Windows.Report.UpdateCurrentDataProviderCapabilities()
at Microsoft.PowerBI.Client.Windows.Report..ctor(PackagePath packagePath, String reportViewDocumentContent, ReportVersionCompatibilityFlags versionCompatibility, ConnectionsSettings connectionSettings, CustomVisualCollection customVisuals, String diagramViewState, ReportLinguisticSchema linguisticSchema, ReportMetadata metadata, ReportSettings reportSettings, StaticResourceCollection staticResources)
at Microsoft.PowerBI.Client.Windows.Services.ReportFactory.CreateReportFromPowerBIPackage(IPowerBIPackage powerBIPackage, String pbixFilePath, Byte[] securityBindings, Boolean requiresConversionToReportLayout, PowerBIPackageOpenOptions options, IPowerBITelemetryService powerBITelemetryService, IAnalysisServicesService analysisServices, PackageValidationResult& mashupValidationResult)
at Microsoft.PowerBI.Client.Windows.Services.PowerBIPackagingService.Open(FileStream fileStream, IPowerBIWindowService windowService, Nullable`1 entryPoint, PowerBIPackageOpenOptions options, Boolean& allCredentialsSatisfied)
at Microsoft.PowerBI.Client.Windows.Services.FileManager.<LoadFromPbix>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.<>c__DisplayClassa`1.<<BlockUIAndRun>b__9>d__c.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.WaitOnUIThreadForTaskCompletion(Task task)
at Microsoft.PowerBI.Client.Windows.Services.UIBlockingService.BlockUIAndRun[T](Func`1 asyncMethod)
at Microsoft.PowerBI.Client.Windows.Services.FileManager.OpenFile(IPowerBIWindowService windowService, IPbixFile fileToOpen, Nullable`1 entryPoint)
at Microsoft.PowerBI.Client.Program.TryOpenOrCreateReport(IUIHost uiHost, ISplashScreen splashScreen, IFileManager fileManager, IFileHistoryManager fileHistoryManager, String filePath, FileType fileType)
at Microsoft.PowerBI.Client.Program.<>c__DisplayClassb.<Main>b__0()
at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<>c__DisplayClass7.<HandleExceptionsWithNestedTasks>b__6()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)

Stack Trace Message:
Collection was modified; enumeration operation may not execute.

Invocation Stack Trace:
at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
at Microsoft.Mashup.Client.UI.Shared.FeedbackErrorInfo..ctor(String message, Exception exception)
at Microsoft.PowerBI.Client.Windows.Telemetry.PowerBIUserFeedbackServices.ReportException(IWindowHandle activeWindow, IUIHost uiHost, FeedbackPackageInfo feedbackPackageInfo, Exception e, Boolean useGDICapture)
at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.<>c__DisplayClass1.<HandleException>b__0()
at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.HandleException(Exception e)
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at Microsoft.PowerBI.Client.Program.Main(String[] args)

powerdax.com
1 REPLY 1
v-jiascu-msft
Employee
Employee

Hi @PowerDAX,

 

To be honest, I would suggest you file a support ticket here for such errors. But you still can try to upgrade the Desktop first.

create ATicket

 

Best Regards,

Dale

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.