Please post a workbook with data, it'll help us help you.
That being said, there are a couple ways to do this, depending on the details. You could add a Group Header column to your database, and have values of 1, 2, etc for each line. Otherwise, it's going to depend on how your data is structured.
Perhaps use an If statement?
Calculated Field 1:
If [something] = 'Measure 1' or [something] = 'Measure 2' then 'Group Header 1'
Elseif [something] = 'Measure 3' or [something] = 'Measure 4' then 'Group Header 2'
Then drag Calculated field 1 to your view.
If we had a workbook, the community could better assist you
Hope this helps!
To get the output you are looking for at Tableau level then you need to pivot the data and write a calculation as shown below.
Hope this works.
Example.twbx 52.6 KB