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
angeloola
Helper I
Helper I

Use parameter to change data connection types (e.g. Denodo to SQL Server)

So, I've seen tutorials that show how to use parameters to switch between server instances or databases on a server, or to change Excel file paths. They are always using the same source TYPE, however.

 

My question is, how to I use parameters to change between completely different data sources? For my particular example, I have a set of views in Denodo that I'm connecting to PowerBI for test. Once I've built a working POC in PowerBI, I push those same tables into Azure SQL instance and reconnect my report to that source. It's tedious at the moment and I want to make it simple. I think it should be possible using parameters. 

 

Can someone demonstrate how do I use source parameters to easily switch between those comletely different data sources?

 

Thanks!

1 ACCEPTED SOLUTION

Hi @angeloola ,

Based on my test, you could refer to below code in query editor with if parameters:

1.PNG

With my sample, I uesed two excel files, you could switch one to your sql query.

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
angeloola
Helper I
Helper I

That's awesome! Thanks @v-danhe-msft ! Can I specify my sources in that parameter using a list (e.g. "SQL" "Denodo"? Or, does it only work with a number?

v-danhe-msft
Employee
Employee

Hi @angeloola ,

You could refer to below blog about how to switch the datasource for your data model:

https://biinsight.com/power-bi-desktop-query-parameters-part-1/

1.PNG

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks, sure I found that one. It's only toggling between two different instances of a SQL Server connection. I'm looking at how I could possibly toggle the connection TYPE (e.g. from a SQL connection to a Denodo or Excel). If you know of any examples of this I'd love to see them.

 

I spent a lot of time on this forum looking for and answer because there's loads of great solutions here. I wasn't able to find a solution for my specific problem... Any other suggestions would be much appreciated. At this point I'm still stuck on this one.

 

-A

 

 

Hi @angeloola ,

Based on my test, you could refer to below code in query editor with if parameters:

1.PNG

With my sample, I uesed two excel files, you could switch one to your sql query.

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.