Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi
I have this setup: my databases where powerbi is connecting to are on a named domain: i.e. db.mycompany.com.
So I can develop locally (as in my office I can see that domain) and publish to online (we deployed the Gateway).
However "one day" the IT won't allow us, internally, to access the domain as is but it will be protected by a SSH named connection: this setup is already working. So I can open a putty connection and change my datasource to localhost:<port> and everything works. However if I do like that, when I publish online I always have to remember to change the data source from localhost:<port> to db.mycompany.com or powerbi online will not be able to see the data.
So the question is: can we a way to tell powerbi that when is't desktop the server should be THIS and when it's online the server should be THAT? I tried with parameters but it doesn't work as when you load the dataset you have to go online and switch to the new parameter value.
thanks
Hi @Anonymous,
In my opinion, I'd like to suggest you setup your connection string as query parameter that you can direct changed on service side.
Please take a look at following link about use query parameter to achieve change datasource on service side:
Using the Power BI Service Parameters to change connection strings (To possibly change between Dev,
Regards,
Xiaoxin Sheng
Hi Xiaoxing.That's how it's setup now, I can change the datasource using the parameter, as it's in the query string.
Unfortunately I can't make the web version automatically detect that it's running on web (instead of desktop) and switch the connection string by itself.
HI @Anonymous,
Have you install a gateway to handling these datasource? I think you need to add these datasources to gateway, then change on 'setting-> datasets-> gateway connection' side.
BTW, query parameter type should be defined with accurate type, 'any' type seems still not works on service side.
Regards,
Xiaoxin Sheng
Hello @Anonymous,
Today Power BI can'ts handle this issue.
Cheers,
Thanks diogo.
I've seen here and there that Powerquery can read url parameters, so in theory i could read the url and if it's present (on desktop won't be valid) can I set the parameter dynamically?
Hello @Anonymous,
The URL Parameters don't work in the same way in service for now.
You can try to get a call response from the url like a ping and after that decide what queryes will go on.
I really never tried make a response of a working website via query, almoust because you will aways get nay response at all.
The cacht in it is the "if it's present"
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.