Forum Discussion
sfung
6 years agoNew Member
Manually moving rows in a table
Hi, I'm reporting data in a table format. I have sorted rows in order by columns but need to manually move one row.. Is there a way to do this? Thanks
- Anonymous6 years ago
waiting foe MS to develop what you nedde, give a try to this function:
let moveRow = (tab,row, posToMove)=> let Pos=Table.PositionOf(tab,row), fromPos=Table.RemoveMatchingRows(tab,{row}), toPos=Table.InsertRows(fromPos,Pos+posToMove,{row}) in toPos in moveRowif you have a table like this and want to move row [col1=22,col2=bb] two position down
you can call the function and get this
if you want to move row [col1=33,col2=cc] two positio up (use a negative relative position)
it is possible using this scheme to add also the management of moving whatever row from pos Pi to position Pf
ziying35
6 years agoImpactful Individual
Hi, sfung
My understanding is that your data needs to be sorted in a particular order, right? Or do you want to keep one row of your data in a fixed position, so that it doesn't participate in sorting. If so, then it can be done, Can you upload a file that has been cleared of sensitive data to cloud disk and then share the link here