What if you were to pivot all of the measures? I took the superstore data and pivoted Discount, Profit, Quantity, and Sales (Profit Ratio is a calculation, so I put that one aside for now). I then created a calculated field called "Group" as follows:
IF [Pivot Field Names]="Discount" or [Pivot Field Names]="Profit" THEN
Then I built the view like the following. Will that work for you?
measure value groupings.twbx 1.2 MB
This is super cool. It gets us part of the way there. When I look at the real full workbook with confidential data, many of the measures are calcs, and we're still on 10.5 for now.
1. When was this pivot feature introduced? I think I missed it somewhere along the way...
2. Is there any workaround for calcs?
I believe it was introduced in version 9, but it only works for Excel and text. My guess is that you're connecting to a real database. In that case, I've written about a couple of options here: 3 Ways to Pivot Data for Tableau - Ken Flerlage: Analytics Architecture, Strategy, & Visualization
For calcs, I think you'd probably need to either 1) recreate those calcs from the pivoted measures or 2) push the calcs to the data layer, then use the SQL method I discussed above.
All that being said, it's probably quite a bit of work...
Thanks for all these ideas / concepts. You've given us plenty to run with. I am marking this as answered, and will try to respond with a complete solution later.
1 of 1 people found this helpful
There are a couple of more options. You could use Table calcs. See attached. I borrowed the technique from:
In the link above, Yuriy offers an alternate solution of padding your datasource. Both of the solutions have their pro's and con's.
I think your best bet is getting the data just right before it gets to Tableau.