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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

0

Direct Query to PowerBI Datasets not working - Sequence contains more than one matching element

After downloading the July-2023 updated version of PowerBI desktop, we are now getting this error message in our datasets that query existing PowerBI datasets.  "Sequence contains more than one matching element"

It seems as if there is now some conflict between the Analysis Server Databases and OneLake and it thinks there are multiple datasets with the same name in this workspace but there isn't.  

 

 

 

Feedback Type:
Frown (Error)

Error Message:
Sequence contains more than one matching element

Stack Trace:
System.InvalidOperationException
   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at Microsoft.PowerBI.Modeling.Engine.Loader.LoadInputToDataModelMap..ctor(IModelInput modelInput, IModelingSession modelingSession, ModelingMashupDocument mashupDocument, IReadOnlyDictionary`2 lastLoadedFormulas)
   at Microsoft.PowerBI.Modeling.Engine.Loader.PowerQueryToModelSchemaSynchronizer.ApplyQuerySchemaToModel(IModelInput modelInput, IExtendedModelChangeScope modelChangeScope, Boolean requireFullDataRefresh)
   at Microsoft.PowerBI.Modeling.Engine.Loader.PowerQueryToModelLoader.ApplyQueriesToModel(IExtendedModelChangeScope modelChangeScope, ModelSchemaSyncContext modelSchemaSyncContext, DataModelSnapshot preTransactionModelSnapshot, Boolean& runRelationshipDetection, List`1& newTableColumnPairs, HashSet`1& existingTableInputs, Boolean& upgradedModel, V3UpgradeStatus& v3UpgradeStatus, List`1& tableInputsExcludedFromSync)


Model Default Mode:
Composite

Model Version:
PowerBI_V3

Enabled Preview Features:
PBI_sparklines
PBI_scorecardVisual
PBI_NlToDax
PBI_fieldParametersSuperSwitch
PBI_horizontalFusion
PBI_setLabelOnExportPdf
PBI_dynamicFormatString
PBI_oneDriveSave
PBI_oneDriveShare
PBI_gitIntegration
PBI_newCard

Disabled Preview Features:
PBI_shapeMapVisualEnabled
PBI_SpanishLinguisticsEnabled
PBI_qnaLiveConnect
PBI_b2bExternalDatasetSharing
PBI_enhancedTooltips
PBI_angularRls
PBI_onObject

Disabled DirectQuery Options:
TreatHanaAsRelationalSource

Cloud:
GlobalCloud

PowerBIUserFeedbackServices_IsReported:
True

shared #"DirectQuery to AS - Ops Metrics (Dev)" = let
    Source = AnalysisServices.Database("powerbi://api.powerbi.com/v1.0/myorg/Flight%20Operations", "Ops Metrics (Dev)"),
    Cubes = Table.Combine(Source[Data]),
    Cube = Cubes{[Id="Model", Kind="Cube"]}[Data]
in
    Cube;

 

 

 

Status: Delivered
Comments
steeleman5000
Regular Visitor

I ended up changing the data source to a different dataset and then switching it back and resetting up the relationships to the other Analysis Server Databases and its back working again

Anonymous
Not applicable

Hi @steeleman5000 

So it works normally , right ? In this case , I will change the status to Delivered .

 

Best Regards,
Community Support Team _ Ailsa Tao

technolog
Super User

In my case, I just found one of the freshly added measures via Tabular Editor that was breaking the update. Removed it from the report. Added it again with a different name and everything worked.

Finding that measure was a matter of successively deleting measures until the update worked.

 

Also from the recommendations I've seen:

Check for Duplicate Elements: Ensure that the data or elements you are querying do not contain duplicates when they are not supposed to. This is often the case when you expect a unique identifier but find multiple entries with the same identifier.