Yes you can create a table like your post.
Please see pic for details. I used a pivot and create an inline table in the script to simulate the two headers.
For your measures you need to set for which primary/secondary header combination should be used to display the value.
Let me know if this answer your question.