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

Help regarding Parameters for changing Data Sources

Hello,

I have created report which is connected to dev environment but now I want to point the report to test environment. Both dev and test are present on same server but in different schemas. How I can dynamically change the report between dev and test environments? I read using parameters we can acheive this so I have created a parameter using List of Values and given the schema names in the list of values. But when I select the Parameter values, the data is not changing in the report even though the data is different in both the environments. Can you please help how I can acheive this?

Please let me know if I am not clear.

Thank you.

5 REPLIES 5
v-lili6-msft
Community Support
Community Support

hi, @Anonymous

You may try to use Parameters in Power BI.

and here are some blogs for you to refer to:

https://www.mssqltips.com/sqlservertip/4475/using-parameters-in-power-bi/

https://community.powerbi.com/t5/Community-Blog/Using-the-Power-BI-Service-Parameters-to-change-connection/ba-p/392016

https://powerbi.microsoft.com/en-us/blog/deep-dive-into-query-parameters-and-power-bi-templates/

 

hope these can help you.

 

Best Regards,
Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-lili6-msft

 

Thanks for sharing the documents, actually I  went through them before posting my question. All those documents has steps to pass parameters when source is SQL Server database. It is straight forward when the source is SQL Server as it has option to select parameter as source. But my source is Impala and it uses ODBC connectivity. Due to this I am finding difficult to pass the parameter while changing to different sources. Please let me know if I am not clear.

LivioLanzo
Solution Sage
Solution Sage

Hi @Anonymous - did you update the M code and link it to the parameter ?

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Anonymous
Not applicable

Hi @LivioLanzo

 

No I havent. I am bit confused how to edit the M code and to link the parameter.  Below is the M code for the table:

 

let
Source = Odbc.DataSource("dsn=Dev", [HierarchicalNavigation=true]),
IMPALA_Database = Source{[Name="IMPALA",Kind="Database"]}[Data],
emp_Schema = IMPALA_Database{[Name="emp",Kind="Schema"]}[Data],
employee_Table = emp_Schema{[Name="employee",Kind="Table"]}[Data]
in
employee_Table

Instead of using "emp" you'd use the parameter name

 

let
Source = Odbc.DataSource("dsn=Dev", [HierarchicalNavigation=true]),
IMPALA_Database = Source{[Name="IMPALA",Kind="Database"]}[Data],
emp_Schema = IMPALA_Database{[Name=parameterName,Kind="Schema"]}[Data],
employee_Table = emp_Schema{[Name="employee",Kind="Table"]}[Data]
in
employee_Table

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

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.