<?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 Power Query - Select certain rows in Power Query</title>
    <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144212#M100735</link>
    <description>&lt;P&gt;Hi, I have certain rows which I want to filter the table. &lt;STRONG&gt;So I only need the first 12 rows of every attribute &lt;/STRONG&gt;(without changing the current sort order)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I filter the table? I know I can manually do that by duplicating queries and then filter the data, but that will be very time consuming as there are 50+ columns. Also I am not sure if any new Attribute might get added/removed. Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Mar 2023 09:18:51 GMT</pubDate>
    <dc:creator>mandar5118</dc:creator>
    <dc:date>2023-03-21T09:18:51Z</dc:date>
    <item>
      <title>Power Query - Select certain rows</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144212#M100735</link>
      <description>&lt;P&gt;Hi, I have certain rows which I want to filter the table. &lt;STRONG&gt;So I only need the first 12 rows of every attribute &lt;/STRONG&gt;(without changing the current sort order)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I filter the table? I know I can manually do that by duplicating queries and then filter the data, but that will be very time consuming as there are 50+ columns. Also I am not sure if any new Attribute might get added/removed. Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 09:18:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144212#M100735</guid>
      <dc:creator>mandar5118</dc:creator>
      <dc:date>2023-03-21T09:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query - Select certain rows</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144253#M100737</link>
      <description>&lt;P&gt;Hello - it looks like you are trying to retain the rows where Column 1 is Aug 2022 - Jul 2023 and column 2 = credit.&amp;nbsp; If that is correct, I recommend filtering those two columns.&amp;nbsp; That should leave you with the expected result without changing the sort order.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 09:40:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144253#M100737</guid>
      <dc:creator>jennratten</dc:creator>
      <dc:date>2023-03-21T09:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query - Select certain rows</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144255#M100738</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="422791" data-lia-user-login="mandar5118" class="lia-mention lia-mention-user"&gt;mandar5118&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;filtered = 
        Table.Combine(
            Table.Group(
                your_table, 
                "Attribute", 
                {{"rows", each Table.FirstN(_, 12)}}
            )[rows]
        )&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 21 Mar 2023 09:40:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144255#M100738</guid>
      <dc:creator>AlienSx</dc:creator>
      <dc:date>2023-03-21T09:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query - Select certain rows</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144303#M100741</link>
      <description>&lt;P&gt;It does give me 12 rows per attribute but the original sort order is disturbed&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 10:13:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144303#M100741</guid>
      <dc:creator>mandar5118</dc:creator>
      <dc:date>2023-03-21T10:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query - Select certain rows</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144305#M100742</link>
      <description>&lt;P&gt;Also if there is a way I can split the queries based on the attribute, that would also help. I can then select keep top 12 rows and then append all the queries&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 10:14:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144305#M100742</guid>
      <dc:creator>mandar5118</dc:creator>
      <dc:date>2023-03-21T10:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query - Select certain rows</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144309#M100743</link>
      <description>&lt;P&gt;No, there are instances where I need debit and credit both&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 10:15:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144309#M100743</guid>
      <dc:creator>mandar5118</dc:creator>
      <dc:date>2023-03-21T10:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query - Select certain rows</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144350#M100747</link>
      <description>&lt;P&gt;In order to retain the sort order, you will need to add an index column and then buffer the table before grouping, like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;AddIndex = Table.AddIndexColumn ( your_table, , "Index", 1, 1, Int64.Type),
Buffered = Table.Buffer ( AddIndex ),
filtered = 
        Table.Combine(
            Table.Group(
                Buffered, 
                "Attribute", 
                {{"rows", each Table.FirstN(_, 12)}}
            )[rows]
        )&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 21 Mar 2023 10:42:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144350#M100747</guid>
      <dc:creator>jennratten</dc:creator>
      <dc:date>2023-03-21T10:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query - Select certain rows</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144353#M100748</link>
      <description>&lt;P&gt;never saw Table.Group or Table.Combine are shuffling data. Anyway, add index column before Table.Group and use this code.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;idx = Table.AddIndexColumn(your_table, "idx", 1, 1),
filtered = 
     Table.Combine(
         Table.Group(
             idx, 
             "Attribute", 
             {{"rows", each Table.FirstN( Table.Sort (_, {"idx"}), 12)}}
         )[rows]
     )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 10:43:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144353#M100748</guid>
      <dc:creator>AlienSx</dc:creator>
      <dc:date>2023-03-21T10:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query - Select certain rows</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144417#M100755</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="233243" data-lia-user-login="jennratten" class="lia-mention lia-mention-user"&gt;jennratten&lt;/a&gt;&amp;nbsp;it seems to me that Table.Buffer alone should work.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 11:13:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144417#M100755</guid>
      <dc:creator>AlienSx</dc:creator>
      <dc:date>2023-03-21T11:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query - Select certain rows</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144616#M100767</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="532285" data-lia-user-login="AlienSx" class="lia-mention lia-mention-user"&gt;AlienSx&lt;/a&gt;&amp;nbsp;, sort of.&amp;nbsp; In the past, I have seen that Table.Buffer alone will work with small tables in which the buffer does not require paging but when paging occurs the rows are reordered by buffer's internal process.&amp;nbsp; However, I am not abe to find my past notes on this or other posts, so I may not be remembering that clearly.&amp;nbsp; However, the second purpose is for the model.&amp;nbsp; Once the table is loaded to the model and placed in a visual, it is nice to be able to specify the sort and the index will enable that functionality.&amp;nbsp; Based on how the visual is actually needing to appear, there could be other types of indexing needed.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 12:48:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Select-certain-rows/m-p/3144616#M100767</guid>
      <dc:creator>jennratten</dc:creator>
      <dc:date>2023-03-21T12:48:40Z</dc:date>
    </item>
  </channel>
</rss>

