Not sure if attached sample fulfills your requirement.
Since your are classifying your Sales lines in the script, I am not sure how to get what you want just by using a set analysis or other chart expression.
In attached sample, I created a linked table for the Sales aggregated over Part# and Invoice# and classified also these lines.
Then I can either look at the most granular lines or at the aggregated lines.
Another way of doing the same is to concatenate both tables, creating a field to flag either the 'detailed' lines resp. 'aggregated' lines. Thus you can have one classification field to select in, and choose what to show by just using the newly created field in a set expression.
Hope this helps,
InvoicesExample_2.qvw 222.8 K