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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AKD
New Member

How to Dynamically change between PowerBI.Dataflows and PowerPlatform.Dataflows Connectors

Hi,

I would like to know if is there a way to  to dynamically change between PowerBI.Dataflows and PowerPlatform.Dataflows Connectors in Power Query editor.  I tried through Parameters, but doesn´t work.

AKD_0-1692209736026.png

AKD_1-1692209773518.png

 

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @AKD ,

According to your description, please try to use a parameter that controls the connector type and pass it as an argument to a custom function that returns the appropriate connector. For example, you can create a parameter called ConnectorType and set its value to either “PowerBI” or “PowerPlatform”. Then, you can create a custom function called GetConnector that takes the parameter as an input and returns either PowerBI.Dataflows(null) or PowerPlatform.Dataflows(null) depending on the parameter value. You can use an if-then-else statement to implement the logic. Here is an example of the code for the custom function:

let
    GetConnector = (ConnectorType as text) as function =>
        if ConnectorType = "PowerBI" then
            PowerBI.Dataflows(null)
        else if ConnectorType = "PowerPlatform" then
            PowerPlatform.Dataflows(null)
        else
            error "Invalid connector type"
in
    GetConnector

You can then use this custom function in your queries to get data from dataflows. For example, you can write something like this:

let
    Source = GetConnector(ConnectorType),
    ...
in
    ...

This way, you can dynamically change the connector type by changing the value of the parameter.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello!

 

Thanks for your help!

 

Maybe some point is missing.🤔

This is the result: 

AKD_0-1692890694115.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors