Hi gopi duppati,
What do you mean switching Datasources?
With your data, you should have a primary and secondary. The order could be swapped in the first Data tab on Tableau Desktop.
I'm not sure this is the answer you were looking for, so be sure to hit that thread again if you need further help
Regretfully, data source A cannot be changed to data source B with a parameter. One option could be to create a view or static table in your database will all data and then use data source parameters to pull only the data needed for the visualization. This community post has a link to some information on that: Re: Change Tableau Data source on change of filter.
I might also suggest posting this over in the Ideas section to recommend adding this as a feature to Tableau.
Hope this helps (even if it's not the answer you were hoping for)!
Depending on your data structure, you might be able to use Unioning. See link below: