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
Alex_G7
Helper I
Helper I

Replace Data Source of Each Query with Generic Data Source

Hi 

I am selecting from view in my projects 

I want change Data source for all queries to generic Data Source when I will move from dev to prod

 

 

1. I created Blank Query 

DS_AG

usinng Advice editor I specified Source as 

let
Source = Sql.Database("DESKTOP-DJZ12\AGCMS", "PowerBIDX")
in
Source

 

 

In my Existing  Query01  Source  

let
Source = Sql.Database("DESKTOP-DJZ12\AGCMS", "PowerBIDX", [Query="SELECT [DATAAREAID] as LegalEntity,#(lf) [NAME] as LegalEntityName#(lf)FROM [V_CompaniesLegalEntities]"])
in
Source

 

 

 

I   want to replace "DESKTOP-DJZ12\AGCMS", "PowerBIDX"  with DS_AG

 

something  like 

let
Source = Sql.Database("DS_AG", [Query="SELECT [DATAAREAID] as LegalEntity,#(lf) [NAME] as LegalEntityName#(lf)FROM [V_CompaniesLegalEntities]"])
in
Source

 

please help with syntax  or  show example

 

 

 

 

 

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

Hi @Alex_G7 ,

 

Based on my test, we can add parameters firstly in power query. I take SQL Server as an example here as the same as yours.

 

123.png

 

Then we can get data and use the Parameter that we created. For more details, please check the online document.

 

12333.png

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Alex_G7 ,

 

Based on my test, we can add parameters firstly in power query. I take SQL Server as an example here as the same as yours.

 

123.png

 

Then we can get data and use the Parameter that we created. For more details, please check the online document.

 

12333.png

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Thank ypu 

 its is very simply and wokring solution

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.