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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Sequence contains no elements error when i add a local data model

Hello community,

 

I am facing a error recently. I have a data set in my dve environement in power bi service which i connect in desktop as live connection and when i click make changes to the model, it is changing to direct query as expected.

 

But when i try the same to the same data set in QA environment (which is pushed using deployment pipeline), i am facing the below error. i tried with prod data set and same issue persist. 

Anonymoous11_0-1695372738919.png

 

 

 

Anyone else facing this issue? Any help is much appreciated.

Status: Investigating

Hi @Anonymoous11 ,

 

The “Sequence contains no elements” error typically occurs when a sequence or collection that is expected to have at least one element is found to be empty. This could be due to a variety of reasons, and it’s often specific to the data or the operations being performed.

Here are a few potential causes and solutions:

1.Check if there are any issues with the data in your QA environment. This could include missing data, incorrect data types, or other inconsistencies that might cause the sequence to be empty.

2.There might be an issue with the query being used to retrieve the data. If the query is not returning any results, it could lead to this error. You might want to review your query and ensure it’s correctly formulated.

we had a user that reported a workaround by refreshing table by table in the model to identify which table was causing the issue. Then they went to Power Query Editor and created another query same as the trouble query, but from scratch. They deleted the one that was causing the issue, named new one exactly the same, and just joined it in the model as the old one was joined.

 

Best regards.
Community Support Team_Caitlyn

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

Hi @Anonymoous11 ,

 

The “Sequence contains no elements” error typically occurs when a sequence or collection that is expected to have at least one element is found to be empty. This could be due to a variety of reasons, and it’s often specific to the data or the operations being performed.

Here are a few potential causes and solutions:

1.Check if there are any issues with the data in your QA environment. This could include missing data, incorrect data types, or other inconsistencies that might cause the sequence to be empty.

2.There might be an issue with the query being used to retrieve the data. If the query is not returning any results, it could lead to this error. You might want to review your query and ensure it’s correctly formulated.

we had a user that reported a workaround by refreshing table by table in the model to identify which table was causing the issue. Then they went to Power Query Editor and created another query same as the trouble query, but from scratch. They deleted the one that was causing the issue, named new one exactly the same, and just joined it in the model as the old one was joined.

 

Best regards.
Community Support Team_Caitlyn

Anonymoous11
Helper I

Hi @v-xiaoyan-msft ,

 

Thank you for your reply. I am facing this error only when i connect to a dataset which is moved through deployment pipeline from dev. 

 

If i connect to the same aas datamodel directly instead of deployment pipeline, i am not having any issue.

 

So i wonder, if there is any limitation for Datasets pushed through deployment pipeline cannot be connverted to direct query model.