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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ErikTavares
New Member

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors