Forum Discussion
An error occurred while processing the semantic model
- 10 months ago
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,
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
- 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.
- Find the duplicates that collide with the temp table’s PK using a GROUP BY check (sample below).
- 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?
- tayloramy10 months agoSuper User
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 1 Data 10/3/2025, 1:08:06 PM 10/3/2025, 3:08:35 PM 2h 0m 28s Failed (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.
- v-veshwara-msft10 months agoCommunity Support
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.