title: Parameterize Source in Power Query when connecting to PostgreSQL DB
body: <p>Using the <a href="https://stackoverflow.com/questions/44793519/cannot-install-microsoft-power-bi-postgre-sql-connector/44795817#44795817">.Net data provider</a> for postgresql, I would like to create an excel workbook that loads some tables from a given schema. The schema is set using a named range in the excel workbook, the table names are the same for each schema.</p>
  
  <p>I tried the following:</p>
  
  <p>Define a query "from other sources" / "blank query" named <code>SchemaIdParam</code> as</p>
  
  <pre><code>let
      rng= Excel.CurrentWorkbook(){[Name="schemaid"]}[Content]
  in
      rng
  </code></pre>
  
  <p>(the name "schemaid" is defined in the workbook.)</p>
  
  <p>Define a query "from PostgreSQL db" named <code>mytable</code> as</p>
  
  <pre><code>let
      src = PostgreSQL.Database("xxx.myhost.com:5235", "my_database"),
      tbl = src{[Schema=SchemaIdParam,Item="mytable"]}[Data]
  in
      tbl
  </code></pre>
  
  <p>Now this does not work. The error message states: "[Expression.Error]: no match between key and rows in table" (own translation). Yet it works if I replace <code>SchemaIdParam</code> by a literal value in quotation marks. Then the correct table is delivered.</p>
  
  <p>Any hints how I can resolve this are very appreciated!</p>
  
  <p>The reason why I want to use a named range for the schema name is that I want to programmatically, outside from excel, set the schema name. I am very open to suggestions how to do this in another way.</p>