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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

The given key was not present in the dictionary

After querying and making changes in my dataset, I receive this warning. I've never had this warning and been using Power Bi desktop for years now. I'm running the latest desktop version for windows 10 and have no new windows updates although there has been one more recently. I'm pulling through Salesforce object connector data and i'm receiving the warning on every single dataset.

Did not have this issue yesterday (17-11-2022)

MarcelRossouw_0-1668771626754.png

 



I've attempted to run a repair of the power bi desktop version but there is no change.

It is urgent that this gets resolved!

Issue Error requested to be added to this issue from Power Bi desktop:

Feedback Type:
Frown (Error)

Timestamp:
2022-11-18T12:13:19.8808451Z

Local Time:
2022-11-18T14:13:19.8808451+02:00

Session ID:
7c15deb5-69e6-45c9-94ea-4ef3c8c7bc9e

Release:
October 2022

Product Version:
2.110.1161.0 (22.10) (x64)

Stack Trace:
System.Collections.Generic.KeyNotFoundException
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Microsoft.PowerBI.Modeling.Engine.Telemetry.LoadModelTelemetryExtensions.LogQueriesLoadToModelCompleted[TErrorMessage](LoadModelTelemetry loadModelTelemetry, IEnumerable`1 queries, IDictionary`2 errorMessages, IDictionary`2 warningMessages, IDictionary`2 queryLoadReasonsDictionary, ModelingMashupDocument mashupDocument, IEnumerable`1 tableInputs, TableInputToQueryMap tableInputToQueryMap, ITracer tracer, IPrivateInformationService piiService)
at Microsoft.PowerBI.Modeling.Engine.Loader.PowerQueryToModelLoader.<>c__DisplayClass16_0.<PerformLoadAsync>b__3()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- 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__DisplayClass8_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__7.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__8`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.<PerformLoadToAnalysisServices>d__18.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__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.Modeling.Engine.Loader.LoadToReportFlow.<Execute>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.ModelingEngine.<LoadModelAsyncInternal>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.<>c__DisplayClass8_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__7.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__8`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__DisplayClass16_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__DisplayClass11_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__14.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__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.FloatingDialog.KoLoadToReportDialog.<>c__DisplayClass34_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.110.1161.0","ModuleName":"Microsoft.PowerBI.Modeling.Engine.dll","Component":"Microsoft.PowerBI.Modeling.Engine.Telemetry.LoadModelTelemetryExtensions","Error":"System.Collections.Generic.KeyNotFoundException","MethodDef":"LogQueriesLoadToModelCompleted","ErrorOffset":"1051"}

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

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

Peak Virtual Memory:
71.9 GB

Private Memory:
1.52 GB

Peak Working Set:
1.73 GB

IE Version:
11.789.19041.0

User ID:
c4f493a5-e95b-4bc6-a8a0-80e8827f5e0b

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

Telemetry Enabled:
True

Model Default Mode:
Import

Model Version:
PowerBI_V3

Enabled Preview Features:
PBI_enableWebView2
PBI_sparklines

Disabled Preview Features:
PBI_shapeMapVisualEnabled
PBI_SpanishLinguisticsEnabled
PBI_qnaLiveConnect
PBI_azureMapVisual
PBI_compositeModelsOverAS
PBI_b2bExternalDatasetSharing
PBI_enhancedTooltips
PQ_WebView2Connector
PBI_scorecardVisual
PBI_NlToDax
PBI_fieldParametersSuperSwitch
PBI_horizontalFusion
PBI_relationshipEditPane

Disabled DirectQuery Options:
TreatHanaAsRelationalSource

Cloud:
GlobalCloud

DPI Scale:
125%

Supported Services:
Power BI




Status: Investigating

Hi @Anonymous ,

 

Please review the content in the following thread, hope that they can help you resolve the problem.

Power BI key errors: Fix them with these detailed solutions

The given key was not present in the dictionary - Brand Pack for Power BI Server

Besides that, please check that there is any table without any column only include measure just as the situation with the following issue thread.

DirectQuery for Power BI datasets and Analysis Services: Error Message

 

Best regards.
Community Support Team_ Caitlyn

 

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

Hi @Anonymous ,

 

Please review the content in the following thread, hope that they can help you resolve the problem.

Power BI key errors: Fix them with these detailed solutions

The given key was not present in the dictionary - Brand Pack for Power BI Server

Besides that, please check that there is any table without any column only include measure just as the situation with the following issue thread.

DirectQuery for Power BI datasets and Analysis Services: Error Message

 

Best regards.
Community Support Team_ Caitlyn

 

IanPanter
New Member

I had the "The given key was not present in the dictionary" when I renamed a query then created a new query using the original name of the query i had just renamed.  I did not save before reusing the name.

 

I resolved the error by changing the name of the new query to something entirely new, applying the changes, saving the file then renaming the query back to the name I wanted to use.

samsonite
Frequent Visitor

Thanks IanPanter, that worked for me!

David_Bridge
New Member

I have had this issue a couple of times following a post-development session where I did some cleaning up of the Power queries.

 

On these occaisions I have renamed, moved, created or deleted FOLDERS in the power queries.

 

My reports have many power queries so folders are impreative to be able to work with the model.

Mostly I notice that it happens following renaming of a folder that contains a query. I think the process is possibly having difficulty either locating the query or maybe it has a reference to the wrong folder (old folder name). If I can remember the old folder name then renaming it back seems to fix the issue. (Good luck if you've made many changes)

 

There is no standard way I can see to read the low-level structure easily.

I guess we could script the json and pretty format it then look through it for inconsistencies but this isn't a reasonable task.

 

Some serious effort needs to go into this from MS as it is mentioned a lot and appears to happen on larger models with frequent change.