I noticed a different behaviour in pivot tables when row are collapsed vs expanded. I found a work-around but I think it is a bug!
I made a quik example in QS Desktop to illustrate the case.
For me expanding a a line is not like doing a selection... Results should be the same at the top level expanded or collapsed. Is it a bug?