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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymousap
New Member

An error occurred while processing the semantic model

Hi Team,

 

I am facing refresh failed on power bi service for many report because of below error, i don't know what do can you help to ressolve this?

An error occurred while processing the semantic model

 

Data source error:{"error":{"code":"DM_GWPipeline_Gateway_MashupDataAccessError","pbi.error":{"code":"DM_GWPipeline_Gateway_MashupDataAccessError","parameters":{},"details":[{"code":"DM_ErrorDetailNameCode_UnderlyingErrorCode","detail":{"type":1,"value":"-2147467259"}},{"code":"DM_ErrorDetailNameCode_UnderlyingErrorMessage","detail":{"type":1,"value":"Microsoft SQL: Violation of PRIMARY KEY constraint 'PK__#tmpJewe__44BDA513E14627E4'. Cannot insert duplicate key in object 'dbo.#tmpJewel'. The duplicate key value is (3144096)."}},{"code":"DM_ErrorDetailNameCode_UnderlyingHResult","detail":{"type":1,"value":"-2147467259"}},{"code":"Microsoft.Data.Mashup.ErrorCode","detail":{"type":1,"value":"10478"}},{"code":"Microsoft.Data.Mashup.ValueError.Class","detail":{"type":1,"value":"14"}},{"code":"Microsoft.Data.Mashup.ValueError.ConnectionId","detail":{"type":1,"value":"a30ec8af-04a6-459b-b7a5-8983d4836ddd"}},{"code":"Microsoft.Data.Mashup.ValueError.DataSourceKind","detail":{"type":1,"value":"SQL"}},{"code":"Microsoft.Data.Mashup.ValueError.DataSourcePath","detail":{"type":1,"value":"auragati02;AuraPbDb"}},{"code":"Microsoft.Data.Mashup.ValueError.ErrorCode","detail":{"type":1,"value":"-2146232060"}},{"code":"Microsoft.Data.Mashup.ValueError.Message","detail":{"type":1,"value":"Violation of PRIMARY KEY constraint 'PK__#tmpJewe__44BDA513E14627E4'. Cannot insert duplicate key in object 'dbo.#tmpJewel'. The duplicate key value is (3144096)."}},{"code":"Microsoft.Data.Mashup.ValueError.Number","detail":{"type":1,"value":"2627"}},{"code":"Microsoft.Data.Mashup.ValueError.Reason","detail":{"type":1,"value":"DataSource.Error"}},{"code":"Microsoft.Data.Mashup.ValueError.State","detail":{"type":1,"value":"1"}}],"exceptionCulprit":1}}} Table: Pbi_BagStatusWIP.
Cluster URI:WABI-INDIA-CENTRAL-A-PRIMARY-redirect.analysis.windows.net
Activity ID:d79fbc96-fe43-4cda-b320-25a28b7ca70e
Request ID:b6b9cbe8-ae85-4f47-b30f-190b4b3deb7a
Time:2025-10-02 17:57:25Z
Details# Type Start End Duration Status Details
1Data10/2/2025, 11:10:52 PM10/2/2025, 11:27:25 PM16m 33sFailed(Show)
1 ACCEPTED SOLUTION

Hi @Anonymousap ,

Thanks for reaching out to Microsoft Fabric Community and thanks for sharing the additional details.

Since the issue is intermittent, it is likely related to how the Power BI mashup engine processes data. Even if the queries run fine in SQL, temporary tables are created in the background during refresh. If these temp tables encounter duplicate values in columns used as keys, or if there are concurrent operations, it can occasionally trigger the “An error occurred while processing the semantic model” message.

Here are some steps given which resolved a similar issue: Solved: Re: Refresh failure - Microsoft Fabric Community

 

As mentioned by @tayloramy , sharing the script that creates any temp tables and the structure of the source tables would also help in understanding why duplicates may be generated.

 

The gateway timeout error seen for PBI_ProdMetalTable is generally unrelated to duplicates. It may happen if the gateway server experiences resource constraints, network latency, or long-running queries. Increasing the timeout settings for the data source can help address this issue as mentioned here: Solved: Re: Dataset refresh error - timeout - Microsoft Fabric Community

 

Also, as already mentioned by @tayloramy checking the gateway server for available resources, running the network port test, and monitoring refresh performance during scheduled windows can help identify the cause. Capturing advanced gateway logs during a failing refresh is also recommended.

 

Thanks to @ibarrau  and @tayloramy  again for addressing this earlier and valuable guidance.

 

Please reach out for further assistance.

Thank you.

View solution in original post

8 REPLIES 8
v-veshwara-msft
Community Support
Community Support

Hi @Anonymousap ,

Just checking in to see if you query is resolved and if any responses were helpful.
Otherwise, feel free to reach out for further assistance.

Thank you.

v-veshwara-msft
Community Support
Community Support

Hi @Anonymousap ,
Just wanted to check if the responses provided were helpful. If further assistance is needed, please reach out.
Thank you.

tayloramy
Community Champion
Community Champion

Hi @Anonymousap

 

@ibarrau beat me to it, posted his reply as I was typing this one, but I figured I'd share anyway.   

 

That error is coming from SQL Server, not Power BI. The gateway is just surfacing it. Specifically, SQL is throwing Error 2627 "Violation of PRIMARY KEY constraint" while inserting into a temp table called #tmpJewel. In plain terms: the INSERT created duplicate key values for the table’s primary key, so SQL rejected the row(s). Power BI then reports DM_GWPipeline_Gateway_MashupDataAccessError because the underlying source operation failed. 

 

Some troubleshooting

  1. Reproduce in SSMS: run the exact stored procedure or native SQL your semantic model uses. You should see the same PK violation outside Power BI.
  2. Find the duplicates that collide with the temp table’s PK using a GROUP BY check (sample below).
  3. Fix at the source query: correct join logic, deduplicate before inserting, or adjust the key definition. Only after the SQL runs cleanly in SSMS will the Power BI refresh succeed.

If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.

Hi @tayloramy Thank you for the solution
i have 8 schedule refresh in a day for this dashboard, out of 8 only 2 or 3 times it fails because this (An error occurred while processing the semantic model) but with same table or diffrent table, other wise it refreshes perfectly, so why this heppens some time and not every times an my SQL queries are working fine in SQL, so can guide me to find root cause for this?

 

Hi @Anonymousap ,

Thanks for reaching out to Microsoft Fabric Community and thanks for sharing the additional details.

Since the issue is intermittent, it is likely related to how the Power BI mashup engine processes data. Even if the queries run fine in SQL, temporary tables are created in the background during refresh. If these temp tables encounter duplicate values in columns used as keys, or if there are concurrent operations, it can occasionally trigger the “An error occurred while processing the semantic model” message.

Here are some steps given which resolved a similar issue: Solved: Re: Refresh failure - Microsoft Fabric Community

 

As mentioned by @tayloramy , sharing the script that creates any temp tables and the structure of the source tables would also help in understanding why duplicates may be generated.

 

The gateway timeout error seen for PBI_ProdMetalTable is generally unrelated to duplicates. It may happen if the gateway server experiences resource constraints, network latency, or long-running queries. Increasing the timeout settings for the data source can help address this issue as mentioned here: Solved: Re: Dataset refresh error - timeout - Microsoft Fabric Community

 

Also, as already mentioned by @tayloramy checking the gateway server for available resources, running the network port test, and monitoring refresh performance during scheduled windows can help identify the cause. Capturing advanced gateway logs during a failing refresh is also recommended.

 

Thanks to @ibarrau  and @tayloramy  again for addressing this earlier and valuable guidance.

 

Please reach out for further assistance.

Thank you.

Hi @Anonymousap

 

This other error you posted is a gateway timeout error:

Data source error:{"error":{"code":"DM_GWPipeline_Gateway_TimeoutError","pbi.error":{"code":"DM_GWPipeline_Gateway_TimeoutError","parameters":{},"details":[],"exceptionCulprit":1}}} Table: PBI_ProdMetalTable.
Cluster URI:WABI-INDIA-CENTRAL-A-PRIMARY-redirect.analysis.windows.net
Activity ID:1038ef22-80bc-486a-a6b5-1c6af4d215ac
Request ID:9de8040d-626e-4d69-84e0-e3a79e2686ed
Time:2025-10-03 09:38:35Z
Details# Type Start End Duration Status Details
1Data10/3/2025, 1:08:06 PM10/3/2025, 3:08:35 PM2h 0m 28sFailed(Show)

 

Can you confirm if it is this error you are seeing? If so I'd recommend checking your gateway server to see that the network port test works and the system is not running out of resources.

 

The original error you showed was referencing a PK violation on a temp table. Can you provide the script that makes the temp table, and the structure of source tables? This might give us an idea as to what is causing it. 
If this is truely intermittent, can you capture advanced gateway logs? 

 

If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.

ibarrau
Super User
Super User

Hi The error is specifying that you have a duplicated value for a column of a table that is used for a relationship a 1 cardinality. It can't contain duplicated so it fails. This message can show what it's talking about:
Violation of PRIMARY KEY constraint 'PK__#tmpJewe__44BDA513E14627E4'. Cannot insert duplicate key in object 'dbo.#tmpJewel'. The duplicate key value is (3144096)."}}, Table: Pbi_BagStatusWIP.

Check for the value 3144096 at the key column used for relationship of the table Pbi_BagStatusWIP. Fix the model issue to check if that value is a wrong data entry or if you should be removing duplicates.

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

@ibarrau Thank you for the relpy,
but Table: Pbi_BagStatusWIP does not contains any primary key and i am facing this erros for other table or view as well, like yesterday same error occured but due to other table 

Data source error:{"error":{"code":"DM_GWPipeline_Gateway_TimeoutError","pbi.error":{"code":"DM_GWPipeline_Gateway_TimeoutError","parameters":{},"details":[],"exceptionCulprit":1}}} Table: PBI_ProdMetalTable.
Cluster URI:WABI-INDIA-CENTRAL-A-PRIMARY-redirect.analysis.windows.net
Activity ID:1038ef22-80bc-486a-a6b5-1c6af4d215ac
Request ID:9de8040d-626e-4d69-84e0-e3a79e2686ed
Time:2025-10-03 09:38:35Z
Details# Type Start End Duration Status Details
1Data10/3/2025, 1:08:06 PM10/3/2025, 3:08:35 PM2h 0m 28sFailed(Show)



Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors