Previously, I asked about how we can fetch a simple previous row through an incremented ID field (Thank you Petr Havlík). In this case I have ID and ACTIVITY, where (ACTIVITY&ID) is the unique value per row.
From an SQL perspective I just do an inner join where ACTIVITY = Joined ACTIVITY and ID = ID - 1 in the joined table and get the row I need.
In other words, I want the previous percentage belonging to the same activity.
So using the answer in the previous post I was able to get the result I want on 1000 rows. However if I were to increase this number of rows to 85000+ this function is dauntingly slow.
=SUMX(FILTER ( Query, (EARLIER ( [ID] ) = [ID] + 1)&&(EARLIER([ACTIVITY])=[ACTIVITY])),[PERCENTAGE])
My end result is to make this function on up to 7 million rows, if this is possible, how I can optimize it ? And if it isn't, could you explain to me why I can't do it ?