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
Anonymous
Not applicable

Change data source of report (eg: switch between SQL server and Teradata/HDinsight) in PBI service

I have a requirement in which the historic data (large volume of data) will be stored in a different datasource and the current data (smaller volume) will be stored in a SQL database.
I was to make a report and publish it in which the datasource will change dynamically according to a filter/front end selection (for example: date filter).

So when I select a histioric date, it should connect to the historic data source and when i select a recent date, it should connect to my SQL database.
The connection will be a direct query, NOT IMPORT.
I wasnt that both the connections should not exist parallelly so that the performance can be improved.

 

So basically, I should have the option of changing the data souce from the frontend (i.e. Power BI service published report, And not .PBIX file).

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

If these datasource has same data structure, you can refer to following blog to parameterize your connection string to achieve dynamic change between different data sources.

Using the Power BI Service Parameters to change connection strings (To possibly change between Dev

You need to add if statement on source step to use parameter to change different connectors:

let
    Source =if SourceType="SQL" then Sql.Database(Server,Database) else Teradata.Database(Server)
in
    Source

Notice: Bold part is query parameters.

 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

@Anonymous Thank you for your reply.
First to add to the context, YES, the schema of the data will remain the same.
But I think this is not a potential solution for my use-case as:
1. I will have to navigate to the dataset settings page to change parameters (Whereas I want the data source to dynamically change with the help of a selection in the report itself)
2. The connection needs to change from SQL to some other data source. So, only parameterizing the database and server link will not suffice

 

Any further help is appreciated. 

Anonymous
Not applicable

HI @Anonymous ,

#1, In fact, report selection and query tables are stored on different data levels. Your can't use query parameter to get report selections and push it to query table side.
Data level: database -> query table[queries, query parameters] -> data model[data model tables, calculated column/table, RLS] -> report view[visual, slicer, filter, measure] 

#2, You can consider to write custom function with different type of data connectors and use if statement and query parameters to achieve dynamic switch data connectors.

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors