Thanks but unfortunately this solution doesn't work with my real report which is much more complicated and has several data sources and numerous measure values.
The option of pivot isn't even available for some reason.
Do you know of some other way to handle these empty rows without reshaping the data? such as hiding empty grand total rows etc..?
Unfortunately, tableau doesn't support conditional filter with measure names at this point.