Description:
If you create a gallery that includes a calculation of underlying values, then change any of those underlying values, the gallery's Selected item will reset to being the first item in the list.
Repro steps:
1) Create TableA_Gallery with an item list from TableA, with Items = AddColumns('TableA', "CalculatedColumn", Sum(LookUp('TableB', TableA_ID = 'TableA'[@ID], NumericValue)))
2) Create a form (TableB_Form) for editing an item from TableB that is included in the calculations in TableA_Gallery
3) Select any item in TableA_Gallery other than the first one
4) Edit the NumericValue field in any row in TableB that is included in the calculations of TableA_Gallery
5) SubmitForm(TableB_Form)
6) TableA_Gallery Selected item will now be the first item in the list, NOT the item selected in Step 3