<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Filter Data in Power Query</title>
    <link>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1250875#M40134</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I don't only reduce data.&lt;/P&gt;&lt;P&gt;I want to filter the data before id loaded to power bi.&lt;/P&gt;&lt;P&gt;My Fact table include 4 milions rows and i want to load just few of them that are found in the excel&amp;nbsp;customers table.&lt;/P&gt;</description>
    <pubDate>Sun, 26 Jul 2020 13:44:32 GMT</pubDate>
    <dc:creator>RsimonAlign</dc:creator>
    <dc:date>2020-07-26T13:44:32Z</dc:date>
    <item>
      <title>Filter Data</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1250748#M40125</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I Have an sql server query and i want to reduce the amount of data by filter the data with list from excel before it loaded to power bi.&lt;/P&gt;&lt;P&gt;For Example :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SQL&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Select * From Customers (Returns 10000 Rows)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Excel&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Customer ID&amp;nbsp;&lt;/P&gt;&lt;P&gt;100&lt;/P&gt;&lt;P&gt;200&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to filter the sql query in the where clause so it can filter and return just the customers in the Excel table.&lt;/P&gt;&lt;P&gt;The Result Need to be just rows of customers 100,200&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TNX&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2020 10:08:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1250748#M40125</guid>
      <dc:creator>RsimonAlign</dc:creator>
      <dc:date>2020-07-26T10:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Data</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1250854#M40132</link>
      <description>&lt;P&gt;If you are just trying to reduce the final amount of data in your model (vs. improve refresh performance), you can use this approach.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Bring in your database data in one query&lt;/P&gt;&lt;P&gt;2. Bring in your excel table in a second query (disable load)&lt;/P&gt;&lt;P&gt;3. On the first query, merge in your excel data query on the Customer column, using an inner join&lt;/P&gt;&lt;P&gt;4. Don't expand the table. Just remove the new column that has the table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This uses the merge step to filter only.&amp;nbsp; You will end up with just the database rows for the customers listed in the Excel file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please mark it as the solution.&amp;nbsp; Kudos are appreciated too.&amp;nbsp; Please let me know if not.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2020 12:44:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1250854#M40132</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-07-26T12:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Data</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1250875#M40134</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I don't only reduce data.&lt;/P&gt;&lt;P&gt;I want to filter the data before id loaded to power bi.&lt;/P&gt;&lt;P&gt;My Fact table include 4 milions rows and i want to load just few of them that are found in the excel&amp;nbsp;customers table.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2020 13:44:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1250875#M40134</guid>
      <dc:creator>RsimonAlign</dc:creator>
      <dc:date>2020-07-26T13:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Data</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1250920#M40139</link>
      <description>&lt;P&gt;Ok.&amp;nbsp; Please try my approach.&amp;nbsp; If it is too slow to refresh, you could also try to "fold" your Excel values into your Filter step of your database query, as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Bring in your Excel data&lt;/P&gt;&lt;P&gt;2. Right click on your customers column and choose "Drill Down".&amp;nbsp; This will convert it to a List of just the values in that column. Call the query "CustomerList".&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; Bring in your database data, and make the first step a Filter step.&amp;nbsp; Choose any few values of customer (you will replace in next step, you just want it to make most of the statement for you).&lt;/P&gt;&lt;P&gt;4.&amp;nbsp; Replace the "each" part in the formula bar with this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Typical Filter step:&amp;nbsp;= Table.SelectRows(#"Previous Step", each ([Customer] = "CustomerA" or [Customer] = "CustomerB"))&lt;/P&gt;&lt;P&gt;Replace With: = Table.SelectRows(#"Previous Step", each List.Contains(CustomerList, [Customer]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you do this filter step right away in your database query, it may "fold" back to the server and have the filtering occur there.&amp;nbsp; Note that you will need to adjust your Privacy settting potentially for this to work (since it requires sending your Customer IDs to your database (which should be fine).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please mark it as the solution.&amp;nbsp; Kudos are appreciated too.&amp;nbsp; Please let me know if not.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2020 15:05:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1250920#M40139</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-07-26T15:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Data</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1251116#M40145</link>
      <description>&lt;P&gt;Tnx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This solution filter the data after is loaded.&lt;/P&gt;&lt;P&gt;I need a solution to filter the data before it loaded.&lt;/P&gt;&lt;P&gt;i need to apply filter in the where statment.&lt;/P&gt;&lt;P&gt;something like :&lt;/P&gt;&lt;P&gt;Select * From customers where CustomerID IN ( &lt;STRONG&gt;List&lt;/STRONG&gt; ).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know what is the&amp;nbsp;syntax to do it ?&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2020 20:13:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1251116#M40145</guid>
      <dc:creator>RsimonAlign</dc:creator>
      <dc:date>2020-07-26T20:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Data</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1251267#M40149</link>
      <description>&lt;P&gt;That is what query folding is.&amp;nbsp; It filters the data on the server before loading it into Power BI.&amp;nbsp; Please give my suggested approach a try.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please mark it as the solution.&amp;nbsp; Kudos are appreciated too.&amp;nbsp; Please let me know if not.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 00:08:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1251267#M40149</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-07-27T00:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Data</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1251797#M40165</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="191679" data-lia-user-login="RsimonAlign" class="lia-mention lia-mention-user"&gt;RsimonAlign&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your description, I created data to reproduce your scenario and tested with Sql Server data source.&lt;/P&gt;
&lt;P&gt;Test:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you connect to Sql Server, you may input the sql statement like below to filter the data.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Allan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif;"&gt;If this post &lt;STRONG&gt;&lt;SPAN style="font-family: 'Arial',sans-serif;"&gt;helps&lt;/SPAN&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;&lt;SPAN style="font-family: 'Arial',sans-serif;"&gt;Accept it as the solution&lt;/SPAN&gt;&lt;/I&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 06:43:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1251797#M40165</guid>
      <dc:creator>v-alq-msft</dc:creator>
      <dc:date>2020-07-27T06:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Data</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1252844#M40198</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Tnx&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;It's work. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;but i needed to change the type of the firlds to text.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 13:31:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Filter-Data/m-p/1252844#M40198</guid>
      <dc:creator>RsimonAlign</dc:creator>
      <dc:date>2020-07-27T13:31:00Z</dc:date>
    </item>
  </channel>
</rss>

