title: How to use list in WHERE IN in SQL code in Power bi?
body: <p>I am trying to load a fraction of a table from SQL database in Power BI using SQL language. I want to use WHERE IN and apply a variable list of values for filtering (this helps to reduce loading time). Since the list is changing, I do not want to write the filter values to the formula.</p>
  
  <p>I tried this formula:</p>
  
  <pre><code>Source = Sql.Database("server", "database", [Query="SELECT header FROM report WHERE header IN ("&amp;List&amp;")"])
  </code></pre>
  
  <p>I get an error message about Text and List mismatch:</p>
  
  <blockquote>
    <p>Expression.Error: We cannot apply operator &amp; to types Text and List.</p>
  </blockquote>
  
  <p>This works, but requires direct typing the filtering values in the formula:</p>
  
  <pre><code>Source = Sql.Database("server", "database", [Query="SELECT header FROM report WHERE header IN ('Item1', 'Item2')"])
  </code></pre>
  
  <p>How can the list be transformed to text? What would be the correct syntax? Is that even possible?</p>