I´ve a nice aggr(rangesum(above example attached. What I don´t get yet is the following: In my example file you find a column in the left straight table that includes the column "Rangesum Passed per Year". The result is already what I want. But I do not want to see only the totals. And the totals also does not make sense in the first month of the year. I want the aggregation for each of the months and then stop when the year switches and start over with the next year. Is this possible?
I detected another issue. It looks like as soon as the column "Rangesum Passed per Year" is activated it changes my values in the other columns like "Rangesum Passed", "Rangesum Total" and "Rangesum % Calculated". This is strange. Why is it affecting it?
If I enable the "Rangesum Passed per Year" it changes the column "Rangesum Passed" and "Rangesum Total". If it is enabled the values get incorrect if it is disabled the other two expressions are correct again.
Plus, I noticed that the result of the first expression is affected by sorting. If you sort by Year, it works fine. If you sort by YearMonth, it does not work. I guess this affects how Above() handles dimensions and whether or not the function is in fact "able" to see on the row above it without TOTAL qualifier.
My way of debugging expressions like this is adding a dummy expression containing only RowNo() to see how dimensions and sort order affects the results.
Ok, it's the interactive sorting that causing the problem. For the rangesum(above( ... )) construct to work correctly the data must be sorted by Year first and YearMonth secondly. Otherwise every YearMonth will be a border where the running total gets reset. So you need to fix the sort order on the Sort tab and disable the Allow Interactive Sort option.