Could not locate the best place to post this... perhaps you can point me to right spot?
I have the follow code snippet I am using in my Power Query.
It adds the quantity of rows I need today. But tomorrow and beyond, the quantity may very well change. I can calculate the quantity I need, and could perhaps fashion a far from eloquent repetitive condition statements, but I've not got a clue on how to code this so that result is always the needed quantity.
In the case I did below, I needed 72 records relating to "AEC Collection". Then after a few days the data source came in with a new record, but I didn't notice. I had to edit the M Code to remove one row. Surely there is a way to code this. In other programing languages, I would have used loop until the quantity was 72, but it appears in Power Query there is not a way to write a loop until.
WithNewRows = Table.InsertRows(SetToAECCol,50,{
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 51],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 52],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 53],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 54],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 55],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 56],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 57],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 58],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 59],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 60],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 61],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 62],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 63],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 64],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 65],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 66],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 67],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 68],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 69],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 70],
[UserName="ITOpenSeat",Product Family="AEC Collection", Index= 71]
}
),