Forum Discussion

Stilish's avatar
Stilish
Frequent Visitor
6 years ago

How to iterate through the rows in a Power Query table applying formulas to each row's data

I am trying to build a FX rate regression model using Power Query that tests a stop loss strategy looking back at historical exchange rates.

I've developed my model to the point where I need to start iterating through the rows(each row represents a time period) in the query to determine when the relevant stop-loss will trigger and at what rate. I've included a picture below that hopefully explains what I am trying to do.

I would be most grateful if someone could guide me how to do this. I have had a look at List.Accumulate but struggling to see how it would help. Greg_Deckler and edhans , you guys seem to really know your stuff..😁

Thanks