Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

OBCD Connection validation error

Hi Guys,

 

I'm using a PowerBi destop to develop a dashboard, my company uses a ci/cd process where there is four environments, DSV, TST, HMG e PRD. In PRD the painel uses a dataflow to get data from database, and the others it uses ODBC query. Thinking about this, we add a code in query to use a parameter on Power Query Editor to choose the connection. 

result = if fonte == 'dataflow'
let
    //dataflow query
in
else
let 
  //odbc query
in

where fonte is a parameter that receive the connection name.
In local desktop it works very good, but in the workspace, it returns an gateway error, probabilly because PowerBI try to validate both of connections, odbc and dataflow. But odbc connection is not acessible on workspace without a gateway, end then it not update anything, dataflow or odbc. Even though, the parameter is dataflow and only dataflow connection will be used. 

What can be done? 

1 REPLY 1
lbendlin
Super User
Super User

You must connect to both sources in all environments. Then your switch can feed a secondary query with the desired output of one or the other query.

 

You cannot switch connections dynamically,  and even more so if the connection type is different.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.