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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

A DirectQuery connection is required - Unable to Add a local model

I am trying to add a new table to the model and encountered this issue.  A pop-up window says "A DirectQuery connection is required" and when I try to submit it, it says "Unable to Add a local model - An error occurred while loading to the model".

 

Feedback Type:
Frown (Error)

Timestamp:
2025-02-06T18:26:19.0263752Z

Local Time:
2025-02-06T10:26:19.0263752-08:00

Session ID:
bca8140a-a7ce-4433-b497-1352e0b50b87

Release:
December 2024

Product Version:
2.139.2054.0 (24.12)+334ca1c95b576cc53924655643b0d36f21caac55 (x64)

Stack Trace:
Microsoft.PowerBI.Client.Windows.AnalysisServices.ExternalDatasetPermissionValidationException
at Microsoft.PowerBI.Client.Windows.AnalysisServices.AnalysisServicesCallbackHelper.<AddPowerBIServiceCredentialsToConnectionStringIfRequired>d__0.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.AnalysisServices.QueryEvaluator.ProxyModelEvaluator.<GetConnectionStringBuilder>d__12.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.AnalysisServices.QueryEvaluator.ProxyModelEvaluator.<EvaluateProxyModelQuery>d__16.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.AnalysisServices.QueryEvaluator.ProxyModelEvaluator.<>c__DisplayClass15_0.<<EvaluateForLoadAsync>b__0>d.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.Modeling.Engine.Evaluation.LoadToModelQueryEvaluationService.<EvaluateForLoadAsync>d__3.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.Modeling.Hosting.ModelingTelemetryService.<>c__DisplayClass11_0`1.<<RunInAsyncActivity>b__0>d.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.Modeling.Hosting.ModelingTelemetryService.<RunInAsyncActivity>d__10.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.Modeling.Hosting.ModelingTelemetryService.<RunInAsyncActivity>d__11`1.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.Modeling.Engine.Loader.LoadToReportFlow.<EvaluateQueries>d__12.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.Modeling.Engine.Loader.LoadToReportFlow.<ExecuteInternal>d__10.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.Modeling.Engine.Loader.LoadToReportFlow.<Execute>d__9.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.Modeling.Hosting.ModelingTelemetryService.<>c__DisplayClass11_0`1.<<RunInAsyncActivity>b__0>d.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.Modeling.Hosting.ModelingTelemetryService.<RunInAsyncActivity>d__10.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.Modeling.Hosting.ModelingTelemetryService.<RunInAsyncActivity>d__11`1.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.Modeling.Hosting.DesktopModelingHost.<>c__DisplayClass17_0.<<LoadToModel>b__1>d.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.Modeling.Engine.Authoring.AsyncModelAuthoringService.<>c__DisplayClass10_0.<<RunExtendedModelChangeAsync>b__0>d.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.Modeling.Engine.Authoring.AsyncModelAuthoringService.<ContinueWithAsyncOperation>d__13.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.Modeling.Hosting.DesktopModelingHost.<LoadToModel>d__17.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.FloatingDialog.KoLoadToReportDialog.<>c__DisplayClass44_0.<<StartLoadToReportFlow>b__0>d.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.IExceptionHandlerExtensions.<HandleAwaitableAsyncExceptions>d__1.MoveNext()

PowerBINonFatalError:
{"AppName":"PBIDesktop","AppVersion":"2.139.2054.0","ModuleName":"Microsoft.PowerBI.Client.Windows.dll","Component":"Microsoft.PowerBI.Client.Windows.AnalysisServices.AnalysisServicesCallbackHelper+<AddPowerBIServiceCredentialsToConnectionStringIfRequired>d__0","Error":"Microsoft.PowerBI.Client.Windows.AnalysisServices.ExternalDatasetPermissionValidationException","MethodDef":"MoveNext","ErrorOffset":"571","ErrorCode":""}

InnerException0.Stack Trace:
at Microsoft.PowerBI.Client.Windows.AnalysisServices.AnalysisServicesCallbackHelper.<AddPowerBIServiceCredentialsToConnectionStringIfRequired>d__0.MoveNext()

OS Version:
Microsoft Windows NT 10.0.19045.0 (x64 en-US)

CLR Version:
4.8 or later [Release Number = 533325]

Peak Virtual Memory:
70.7 GB

Private Memory:
793 MB

Peak Working Set:
1.12 GB

IE Version:
11.3636.19041.0

User ID:
14a4d80c-3261-4070-9ddc-fcde2163b974

Workbook Package Info:
1* - en-US, Query Groups: 0, fastCombine: Disabled, runBackgroundAnalysis: False.

Telemetry Enabled:
True

AS Live Connection:
True

Enabled Preview Features:
PBI_sparklines
PBI_scorecardVisual
PBI_fieldParametersSuperSwitch
PBI_setLabelOnExportPdf
PBI_oneDriveSave
PBI_oneDriveShare
PBI_useModernPublishDialogs
PBI_gitIntegration
PBI_directLakeRemoteModeling
PBI_newCard
PBI_buttonSlicerAuthoring
PBI_EimLessElevatedUser
PBI_mobileAutoReportLayout
PBI_daxInlineCopilot
PBI_aiNarrativesVisual
PBI_generateMeasureDescriptionsButton
PBI_visualCalculationsAuthoring
PBI_desktopReportAuthoringCopilot

Disabled Preview Features:
PBI_snowflakeAdbcVersionEnabled
PBI_shapeMapVisualEnabled
PBI_SpanishLinguisticsEnabled
PBI_qnaLiveConnect
PBI_metricsArtifactsOnDesktop
PBI_b2bExternalDatasetSharing
PBI_enhancedTooltips
PBI_onObject
PBI_odspSaveBackgroundUpload
PBI_modernOfficeFilePicker
PBI_publishDialogsSupportSubfolders
PBI_tmdlInDataset
PBI_enhancedReportFormat
PBI_advancedSlicerTypeList
PBI_textSlicer
PBI_qnaImproveLsdlCopilot
PBI_tmdlViewToggle

Disabled DirectQuery Options:
TreatHanaAsRelationalSource

Cloud:
GlobalCloud

DPI Scale:
125%

Supported Services:
Power BI

Status: Investigating

Hi @stevenchan ,

 

Please make sure that the connection information for your data source is up-to-date. In Power BI Desktop, go to Home > Transform Data > Data source settings, find the source that's causing the issue, and update the connection information.

Then you may check the query folding.If the transformations cannot be folded, it can cause errors. You can check for query folding issues by right-clicking on a step in the Power Query Editor and selecting "View Native Query"

 

Best Regards,
Community Support Team _ Caitlyn

 

Comments
v-xiaoyan-msft
Community Support
Status changed to: Investigating

Hi @stevenchan ,

 

Please make sure that the connection information for your data source is up-to-date. In Power BI Desktop, go to Home > Transform Data > Data source settings, find the source that's causing the issue, and update the connection information.

Then you may check the query folding.If the transformations cannot be folded, it can cause errors. You can check for query folding issues by right-clicking on a step in the Power Query Editor and selecting "View Native Query"

 

Best Regards,
Community Support Team _ Caitlyn