AFAIK, current power bi does not exist row and column index. If you want to cumulative these records, you need to add an index field first, then you can use the index to look up corresponding records and calculate.
In addition, I'd like to suggest you use selectedvalue and switch function to navigate to the specific calculations expression based on the current category:
My Favorite DAX Feature: SELECTEDVALUE with SWITCH | Winston-Salem Power BI User Group (pbiusergroup...
Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.