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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
itsMeKapz
New Member

Change data source dynamically using a Slicer by binding to parameter

I have two identical SQL Server DBs hosted in two different servers. I want to create a report so that I can switch between both the servers and see data accordingly. I have followed this video and managed to do it upto some extent but it is not getting successful result. Below are the steps I followed, can you point if I'm doing anything wrong?

 

1. Created a DirectQuery data source

itsMeKapz_1-1707904092858.png

 

 

2. Created a parameter - Company (string)

 

3. Created a table using 'Enter Data' to house two Company names - tblCompany (ComName string)

 

4. Bind the parameter 'Company' to ComName in above created table

 

5. A slicer added in the report to select between companies in tblCompany

 

Worked fine upto this point..

 

6. Changed in M query of 1st direct query dataset to change data source according to the parameter:

itsMeKapz_2-1707904691502.png

 

Now the report is giving error on visuals from DirectQuery table:

itsMeKapz_3-1707904826846.png

 

What is this error? Is there any other way to get this done?

TIA

1 REPLY 1
v-weiyan1-msft
Community Support
Community Support

Hi @itsMeKapz ,

 

Based on the current capabilities of Power BI and as of my latest knowledge, slicers and query parameters work on different levels, you can't use a front-end slicer to influence back-end query parameters.
Reference: Dynamically Change Data Source Using Parameter and... - Microsoft Fabric Community

However, you can refer to the method in the following link as a workaround.

Change the Source of Power BI Datasets Dynamically Using Power Query Parameters - RADACAD

 

Best Regards,
Yulia Yan


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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.