That's just trying to define the so called row segments, though it's quite hard to understand, I agree.
Have you come across the column segments in a table? Row segments are just the equivalent for horizontal dimensions in a pivot table.
You can see the row segment bounderies by using rowno() function in your pivot.
I assume you need to apply the TOTAL qualifier to your before function (assuming that you want to ignore the row segment bounderies). Not sure why you get zero for all values, though.
Can you post your complete dimensions and expression here? Or even better, a small sample file?