Thanks for your reply.
However, the chart stayed exactly the same.
The confusing is - the offset is apparently calculated ok (according to the table seen in the picture above).
I don't get why then the chart inserts two gaps ONLY between two last elements.
Moreover, it seems that all other elements (red bars) are ok positioned...
I have noticed also the following:
First row (Cancelld_YN = 'N') is the starting column in the waterfall chart (bar height 6439). Here the hight is ok (6493).
In the last two column in the picture I have separated the offset expressions as follows:
Column (if(rowno() = 2...) calculates like this: top(total Counter)
Column (rangesum_1) as this: rangesum((top(total Counter,2,rowno(total))))
Here I notice that the rangesum_1 column does not calculate correctly. It should calculate the values in the following order: 40, 77, 80, 117, ... So the problem should be here.