Forum Discussion
Is it Possible to Parameterize Server Type - Switch From MySQL to SQL Server?
- 1 year ago
I ended up doing it by making Source conditional, based off value of parameter, within the Power Query advanced editor.
I'm using the approach below.
let Source =if server= "xerxes" then MySQL.Database("xerxes.corp.brillo.com", "brilloweb_api", [Query="select *#(lf)from products;", ReturnSingleDatabase=true]) else if server = "alexander" then Sql.Database("alexander.corp.brillo.com", "brilloweb_api", [Query="SELECT * FROM products p;"]) else MySQL.Database("xerxes.corp.brillo.com", "brilloweb_api", [Query="select *#(lf)from products;", ReturnSingleDatabase=true]) in Source
Running native queries I write. Thank you for the links/info.
- lbendlin1 year agoSuper User
Ok here's my proposal:
in your Power Query script have both the SQL and the MySQL Sources. Make the query dynamic so that the "inactive" connection runs something like "Select top 0 ... ", and the "active" connection runs your actual query. Append both queries.
- jrieman1 year agoFrequent Visitor
I ended up doing it by making Source conditional, based off value of parameter, within the Power Query advanced editor.
I'm using the approach below.
let Source =if server= "xerxes" then MySQL.Database("xerxes.corp.brillo.com", "brilloweb_api", [Query="select *#(lf)from products;", ReturnSingleDatabase=true]) else if server = "alexander" then Sql.Database("alexander.corp.brillo.com", "brilloweb_api", [Query="SELECT * FROM products p;"]) else MySQL.Database("xerxes.corp.brillo.com", "brilloweb_api", [Query="select *#(lf)from products;", ReturnSingleDatabase=true]) in Source- lbendlin1 year agoSuper User
Your code is redundant - you could fold the SQL server into the Else branch.
Does the refresh work on the Power BI Service?