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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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.
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:
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |