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
Nreddy
New Member

Dynamic connection based on selection on slicer

Hello Folks,

I Need help to achieve below Requirement.

We do have different region data in different databases and we do have all connection, Username,password details on the metadata database.

The requirement is

In slicer (Region) if we select US than I will query from metadata and get the connection details and get connected to that Us database and fetch the us related data.

I'm completely lost and any help is much appreciated.

Thanks,
Naveen

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @Nreddy ,

 

If you use Direct Query to connect to your data source, I suggest you to try dynamic M query parameters. You can use slicer to get dynamic username and password then pass the data to query by parameter.

For reference:

Dynamic M query parameters in Power BI Desktop

If you use import connection mode, I suggest you to create username and password parameters in M query. Add the parameter into your query as above and you can choose parameter to change your data.

 

Best Regards,
Rico Zhou

 

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

1 REPLY 1
v-rzhou-msft
Community Support
Community Support

Hi @Nreddy ,

 

If you use Direct Query to connect to your data source, I suggest you to try dynamic M query parameters. You can use slicer to get dynamic username and password then pass the data to query by parameter.

For reference:

Dynamic M query parameters in Power BI Desktop

If you use import connection mode, I suggest you to create username and password parameters in M query. Add the parameter into your query as above and you can choose parameter to change your data.

 

Best Regards,
Rico Zhou

 

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.