This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
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)
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.
Best Regards,
Dale
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 29 | |
| 27 | |
| 25 | |
| 20 | |
| 14 |
| User | Count |
|---|---|
| 53 | |
| 47 | |
| 22 | |
| 19 | |
| 19 |