PDA

View Full Version : PQ-how many last rows to show determined by single row table



sandy666
07-11-2023, 08:40 PM
DateIDNameCompanyCountryCitySalesLastNDateIDNameCo mpanyCountryCitySales


21/03/201816850307-6211Felix WeissSem LLPSierra LeoneFeldkirchen in Kärnten
32638
6
28/09/201716550503-5773Maxine D. TalleyAc Eleifend Vitae FoundationIcelandPiracicaba
16604


18/04/201816300905-7245Maggy Z. CruzMalesuada Augue Corp.TongaCuracautÃ*n
42560
23/02/201916690717-4236Colt GallowayDolor InstituteMyanmarBella
22210


02/08/201716910128-2987Melyssa HaleMi CorporationLiechtensteinTemuka
18179
15/10/201716760516-8892Lawrence RobertsonNec Malesuada Ut Corp.MoroccoCerchio
29323


19/01/201816340924-6224Beau E. ColonUltrices Iaculis Odio CorporationKazakhstanGouvy
33995
10/12/201716081122-7446Rashad WittLuctus Ipsum Corp.AndorraStralsund
25673


01/06/201816490821-7609Brenden RoachNulla Aliquet PCBotswanaMeerdonk
15790
20/04/201716370301-5291Harding B. LeonardAc Facilisis Facilisis IndustriesBangladeshPetrópolis
41707


23/04/201716590903-0263Ahmed U. JoynerNec Cursus LLPFijiMonte Patria
36711
26/02/201916820113-8164Chanda DudleyDonec Egestas InstituteLebanonBlind River
20379


06/04/201916760811-7656Signe ReillySuspendisse Ac Metus LimitedUruguayMoorsel
27122


21/05/201716161112-9816Candice G. SotoEnim LimitedCape VerdeJuneau
30222


06/08/201816301111-8365Casey N. RivasAmet LimitedNicaraguaCartagena
12355


29/11/201816600616-1431Bevis WhitneyPharetra Nibh Aliquam LLPUkraineOderzo
5335


12/01/201916960108-3315Ralph D. AndrewsUltricies Ligula Corp.AngolaLives-sur-Meuse
10757


27/09/201716400628-3396Cherokee AnthonyMalesuada LLCAndorraCoaldale
24476


06/03/201916150805-6767Zachary StoutMontes Nascetur LimitedAustriaPalma de Mallorca
21099


04/11/201816081021-5574Ora HillDuis At CompanySierra LeoneOllagüe
15549


26/02/201916611126-8857Buffy B. RosaAc Orci Ut LLCHondurasMaizeret
16860


30/08/201716550804-4731Blair CooleyAt Risus Nunc Inc.SwitzerlandErdemli
44575


11/05/201816880605-5177Damian E. SaundersConvallis Est Vitae IndustriesSouth SudanSaint-LŽger
26105


21/12/201716370909-7871Daphne Z. NguyenCommodo Ipsum FoundationMyanmarPoole
23005


02/08/201816650708-5287Rina ChaneyMauris Inc.BotswanaLuzzara
38850


14/05/201716520424-3629Ivor DudleyEget Ipsum IncorporatedCongo (Brazzaville)Yerbas Buenas
34126


22/05/201816840222-8426Nolan E. ParkDapibus Quam IncorporatedMaliPazarcık
35027


09/01/201816350412-2924Chastity LewisEros InstituteChristmas IslandSan Rafael
15116


08/01/201916091108-1446Olivia K. HumphreyMassa CorporationPanamaMoncrivello
25807


15/03/201816460829-8305Ahmed F. ShermanArcu ConsultingCape VerdeKelowna
20875


14/02/201916670528-1738Oscar FranklinAt Pretium Aliquet Inc.Ã…land IslandsFort St. John
35833



// 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