Forum Discussion
Gateway datasource limit breaking ISV use case
Hi Piloos , Thank you for reaching out to the Microsoft Community Forum.
In Power BI, if multiple databases are present on the same MySQL instance, you can link multiple datasets to a single gateway datasource by using dynamic database switching in the query. This is possible if the gateway datasource is set to point to the MySQL instance rather than a specific database, and the Power Query (M) or SQL statement dynamically references the necessary database.
Please try the following steps:
- In Power BI Service, go to Manage Gateways and create one gateway datasource that connects to the MySQL server instance. Ensure the credentials used have access to all target databases.
- Instead of directly connecting to a specific database, modify your Power Query (M) script to dynamically specify the database.
- The ModelRefreshFailed_CredentialsNotSpecified error occurs because Power BI stores credentials at the datasource level. If different datasets override the database dynamically, Power BI may not automatically pass credentials. To resolve this, Go to Power BI Service -> Settings -> Dataset Settings. Locate the dataset that fails to refresh. Ensure it’s using the same credentials as the gateway datasource. Set the authentication method to Basic or OAuth (depending on your setup). Save and apply the changes.
- If Power BI still fails to refresh, consider using DirectQuery mode instead of Import mode. DirectQuery allows Power BI to send queries dynamically without needing separate refresh credentials for each dataset. If your data volumes are manageable, switching to DirectQuery may eliminate the need for individual refreshes.
If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
Hi v-hashadapu
In Power BI, if multiple databases are present on the same MySQL instance, you can link multiple datasets to a single gateway datasource by using dynamic database switching in the query. This is possible if the gateway datasource is set to point to the MySQL instance rather than a specific database, and the Power Query (M) or SQL statement dynamically references the necessary database.
Sounds like a plan. I tried it out, but I couldn't manage to create a MySQL datasource without specifying the database. Any clue how to achieve this? Before I start doing this using the REST API, I first want to validate the solution manually in ther service. If I create a gateway datasource there, the database is a required field.
Could it have something to do with the Power Query statement?
Source = MySQL.Database(db_server, db_name, [ReturnSingleDatabase=true, CreateNavigationProperties=false]),
- v-hashadapu1 year agoCommunity Support
Hi Piloos , Thank you for reaching out to the Microsoft Community Forum.
Please try this:
- When setting up the gateway data source, specify any valid database as a placeholder. Ensure that the user has privileges to access all required databases on the MySQL instance.
- Modify the Power Query (M) script to dynamically switch databases. Example:
let
db_server = "your-mysql-server",
db_name = "dynamic_db_name", // Replace dynamically
Source = MySQL.Database(db_server, db_name, [ReturnSingleDatabase=true, CreateNavigationProperties=false])
in
Source
- Ensure the dataset credentials match those set in the gateway.
If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.- Piloos1 year agoAdvocate I
Hi v-hashadapu ,
Thanks for your feedback.
I couldn't get it to work.
These are the steps I took:
1) I create a gateway datasource with database A
2) I have a semantic model with db_name A specified in a parameter
3) I bind the gateway datasource to semantic model. So far so good. I can refresh the semantic model via the gateway.
4) I change the parameter db_name to B --> the semantic model does not seem to be bound anymore. If I try to refresh, I indeed get the confirmation that there is something wrong and I need to specify a gateay.
In the mean time, I also got an update from the product team. In order for this to work, it should be possible to create a MySQL gateway datasource without a specific database. At the moment this does not seem possible. They said that they would look into it.
- lbendlin1 year agoSuper User
You could wait for them or you could write your own custom connector.