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
Are you using Query Folding? Are you using native queries?
I believe folding. Simple select * against data warehouse table. When I right click 'Source' under APPLIED STEPS, view native query is greyed out. I think that indicates I'm folding?
- lbendlin1 year agoSuper User
unfortunately it (mostly) means the opposite. You can only be certain though when you run the query diagnostics. Sometimes the "View native query" is greyed out but the diagnostics still show a folded query call.
Understanding query evaluation and query folding in Power Query - Power Query | Microsoft Learn
Are you crafting your own queries? Are you setting the "EnableFolding" attribute?
Query folding on native queries - Power Query | Microsoft Learn