Forum Discussion
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
- LivioLanzoSolution Sage
Hi Anonymous - did you update the M code and link it to the parameter ?
- LivioLanzoSolution Sage
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 - AnonymousNot 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
- v-lili6-msftCommunity 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://powerbi.microsoft.com/en-us/blog/deep-dive-into-query-parameters-and-power-bi-templates/
hope these can help you.
Best Regards,
Lin- AnonymousNot 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.