Forum Discussion

itsMeKapz's avatar
itsMeKapz
New Member
2 years ago

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

 

 

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:

 

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

 

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

TIA

1 Reply