- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dynamic Connection (PostgreSQL or SQL Server) with Power BI Gateway
Hi guys,
I have a report template in Power BI that will be replicated to several clients, and the Data Warehouse of these clients may vary between PostgreSQL and SQL Server.
To avoid keeping two separate PBIX files (one exclusively for PostgreSQL and the other for SQL Server), I tried to create a dynamic connection using parameters and conditionals (if-else) in Power Query. The idea is that, based on a defined parameter, the query dynamically uses the correct connector: PostgreSQL.Database or Sql.Database.
In Power BI Desktop, this approach works correctly. However, when publishing to Power BI Online, the service does not correctly recognize the data source, displaying the message:
“Some data sources cannot be listed due to manually created queries.”
As a result, I can't configure the gateway or schedule automatic updates.
Has anyone ever faced this situation or know of a practical and functional solution for maintaining dynamic connections between PostgreSQL and SQL Server in a single PBIX file, which is compatible with scheduled updates in Power BI Online?
Thanks in advance for any tips or guidance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi adznnn7b,
We have not received a response from you regarding the query and were following up to check if you have found a resolution. If you have identified a solution, we kindly request you to share it with the community, as it may be helpful to others facing a similar issue.
If you find the response helpful, please mark it as the accepted solution and provide kudos, as this will help other members with similar queries.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Create two connections. Use a parameter to decide which of them should return data, and which should return an empty table. Create two gateway connections accordingly. Set both connection to skip the connection test.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can try Expression.Evaluate but it likely will also be treated that way.

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
07-17-2024 11:14 AM | |||
09-24-2024 01:00 AM | |||
02-06-2024 11:38 PM | |||
04-27-2024 12:58 AM | |||
Anonymous
| 10-06-2021 12:50 AM |
User | Count |
---|---|
28 | |
28 | |
23 | |
14 | |
10 |
User | Count |
---|---|
24 | |
21 | |
17 | |
10 | |
9 |