While I’m probably just daring @Melissa to prove me wrong here, I think in the case of retrieving previous row values, DAX may be a better bet here in terms of size and performance than Power Query. @Greg has put together a terrific DAX Patterns section on Previous Row Value that I would recommend you review and try some of the variations he delves into: