Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

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

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

    • LivioLanzo's avatar
      LivioLanzo
      Solution 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

    • Anonymous's avatar
      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

    • Anonymous's avatar
      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.