Forum Discussion
Dynamic Connection (PostgreSQL or SQL Server) with Power BI Gateway
- 1 year ago
Thank you, lbendlin , for your response.
Hi adznnn7b,We appreciate your query on the Microsoft Fabric Community Forum.
Please find attached the document link and a screenshot for your reference, which may assist in resolving the issue:
Data refresh in Power BI - Power BI | Microsoft Learn
As per my research, the message, "Some data sources may not be listed because of hand-authored queries," indicates that the service detects dynamic data source definitions, which it cannot process for scheduled refreshes.
The Power BI Service has certain limitations concerning dynamic data source connections, particularly when parameters or conditional logic are used to switch between different data sources. This restriction primarily arises due to security and infrastructure considerations, as dynamically changing data sources can create challenges for the service’s data refresh and gateway configuration processes.
As a workaround,consider using Power BI Dataflows to perform the Extract, Transform, Load (ETL) processes for both PostgreSQL and SQL Server data sources. Dataflows allow you to centralize and standardize data transformation logic. The reports can then connect to these dataflows as their data source, simplifying the management of data connections and refresh schedules.If you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.
Thank you.
This was one of the approaches I tested, but Power BI Online still treats the query as manual/dynamic, preventing the Gateway from being configured.
What I did was create two connections:
SQL Server using Sql.Database().
PostgreSQL using PostgreSQL.Database().
I then used a parameter to activate one and return an empty table in the other, avoiding simultaneous queries to both databases.
Despite this, Power BI Online still doesn't recognize the sources in the Gateway, displaying the message:
“Some data sources may not be listed because of hand-authored queries”
This seems to indicate that the simple fact of conditioning the choice of connection is already interpreted as a dynamic query, blocking automatic updating.
You can try Expression.Evaluate but it likely will also be treated that way.