Results 1 to 1 of 1

Thread: PQ-how many last rows to show determined by single row table

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sir Moderator sandy666's Avatar
    Join Date
    May 2018
    Posts
    239
    Rep Power
    7

    Cool PQ-how many last rows to show determined by single row table

    Date ID Name Company Country City Sales LastN Date ID Name Company Country City Sales
    21/03/2018
    16850307-6211 Felix Weiss Sem LLP Sierra Leone Feldkirchen in Kärnten
    32638
    6
    28/09/2017
    16550503-5773 Maxine D. Talley Ac Eleifend Vitae Foundation Iceland Piracicaba
    16604
    18/04/2018
    16300905-7245 Maggy Z. Cruz Malesuada Augue Corp. Tonga CuracautÃ*n
    42560
    23/02/2019
    16690717-4236 Colt Galloway Dolor Institute Myanmar Bella
    22210
    02/08/2017
    16910128-2987 Melyssa Hale Mi Corporation Liechtenstein Temuka
    18179
    15/10/2017
    16760516-8892 Lawrence Robertson Nec Malesuada Ut Corp. Morocco Cerchio
    29323
    19/01/2018
    16340924-6224 Beau E. Colon Ultrices Iaculis Odio Corporation Kazakhstan Gouvy
    33995
    10/12/2017
    16081122-7446 Rashad Witt Luctus Ipsum Corp. Andorra Stralsund
    25673
    01/06/2018
    16490821-7609 Brenden Roach Nulla Aliquet PC Botswana Meerdonk
    15790
    20/04/2017
    16370301-5291 Harding B. Leonard Ac Facilisis Facilisis Industries Bangladesh Petrópolis
    41707
    23/04/2017
    16590903-0263 Ahmed U. Joyner Nec Cursus LLP Fiji Monte Patria
    36711
    26/02/2019
    16820113-8164 Chanda Dudley Donec Egestas Institute Lebanon Blind River
    20379
    06/04/2019
    16760811-7656 Signe Reilly Suspendisse Ac Metus Limited Uruguay Moorsel
    27122
    21/05/2017
    16161112-9816 Candice G. Soto Enim Limited Cape Verde Juneau
    30222
    06/08/2018
    16301111-8365 Casey N. Rivas Amet Limited Nicaragua Cartagena
    12355
    29/11/2018
    16600616-1431 Bevis Whitney Pharetra Nibh Aliquam LLP Ukraine Oderzo
    5335
    12/01/2019
    16960108-3315 Ralph D. Andrews Ultricies Ligula Corp. Angola Lives-sur-Meuse
    10757
    27/09/2017
    16400628-3396 Cherokee Anthony Malesuada LLC Andorra Coaldale
    24476
    06/03/2019
    16150805-6767 Zachary Stout Montes Nascetur Limited Austria Palma de Mallorca
    21099
    04/11/2018
    16081021-5574 Ora Hill Duis At Company Sierra Leone Ollagüe
    15549
    26/02/2019
    16611126-8857 Buffy B. Rosa Ac Orci Ut LLC Honduras Maizeret
    16860
    30/08/2017
    16550804-4731 Blair Cooley At Risus Nunc Inc. Switzerland Erdemli
    44575
    11/05/2018
    16880605-5177 Damian E. Saunders Convallis Est Vitae Industries South Sudan Saint-LŽger
    26105
    21/12/2017
    16370909-7871 Daphne Z. Nguyen Commodo Ipsum Foundation Myanmar Poole
    23005
    02/08/2018
    16650708-5287 Rina Chaney Mauris Inc. Botswana Luzzara
    38850
    14/05/2017
    16520424-3629 Ivor Dudley Eget Ipsum Incorporated Congo (Brazzaville) Yerbas Buenas
    34126
    22/05/2018
    16840222-8426 Nolan E. Park Dapibus Quam Incorporated Mali Pazarcık
    35027
    09/01/2018
    16350412-2924 Chastity Lewis Eros Institute Christmas Island San Rafael
    15116
    08/01/2019
    16091108-1446 Olivia K. Humphrey Massa Corporation Panama Moncrivello
    25807
    15/03/2018
    16460829-8305 Ahmed F. Sherman Arcu Consulting Cape Verde Kelowna
    20875
    14/02/2019
    16670528-1738 Oscar Franklin At Pretium Aliquet Inc. Ã…land Islands Fort St. John
    35833


    Code:
    // Table1
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        Counter = Table.FirstValue(Excel.CurrentWorkbook(){[Name="Table2"]}[Content]),
        Type = Table.TransformColumnTypes(Source,{{"Date", type date}, {"ID", type text}, {"Name", type text}, {"Company", type text}, {"Country", type text}, {"City", type text}, {"Sales", Int64.Type}}),
        LastN = Table.LastN(Type,if Counter=null then 0 else Counter)
    in
        LastN
    source is bigger so see attachment
    sandy
    I know you know but I forgot my Crystal Ball and don't know what you know also I may not remember what I did weeks, months or years ago so answer asap. Thinking doesn't hurt

Similar Threads

  1. Replies: 13
    Last Post: 10-06-2022, 02:57 PM
  2. Replies: 0
    Last Post: 05-14-2020, 09:50 PM
  3. PQ - Table.Partition - split single table to three tables by year
    By sandy666 in forum ETL PQ Tips and Tricks
    Replies: 0
    Last Post: 05-14-2020, 07:35 AM
  4. Replies: 1
    Last Post: 03-01-2015, 12:11 AM
  5. Filter Pivot Table Based On Selected Value And Show All Results Though VBA
    By hanishgautam in forum Excel and VBA Tips and Tricks
    Replies: 4
    Last Post: 07-09-2013, 07:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •