Please do not mark this as duplicated of Sum of Max in PivotTable for Excel because there is no even answer for it.
I have a pivot table of items grouped by ID and month, and getting the maximum Q among all items. So the totals get the maximums as well.
+------------+---------+----------------+
| A | B | C |
+-+------------+---------+----------------+
|1| Month | ID | Max(Q) |
+-+------------+---------+----------------+
|2| 1 | A | 23 |
+-+------------+---------+----------------+
|3| 1 | B | 11 |
+-+------------+---------+----------------+
|4| Subtotal 1 | 23 |
+-+------------+---------+----------------+
|5| 2 | C | 85 |
+-+------------+---------+----------------+
|6| 2 | D | 6 |
+-+------------+---------+----------------+
|7| Subtotal 2 | 85 |
+-+------------+--------------------------+
|8| Total 85 |
+-+---------------------------------------+
What I want to do is still get the max of each ID, but the totals to be the sum of the maximums. Like the following.
+------------+---------+----------------+
| A | B | C |
+-+------------+---------+----------------+
|1| Month | ID | Sum(Max(Q)) |
+-+------------+---------+----------------+
|2| 1 | A | 23 |
+-+------------+---------+----------------+
|3| 1 | B | 11 |
+-+------------+---------+----------------+
|4| Subtotal 1 | 34 |
+-+------------+---------+----------------+
|5| 2 | C | 85 |
+-+------------+---------+----------------+
|6| 2 | D | 6 |
+-+------------+---------+----------------+
|7| Subtotal 2 | 91 |
+-+------------+--------------------------+
|8| Total 125 |
+-+---------------------------------------+
I can't do the trick of this video https://www.youtube.com/watch?v=URfAkq0_dj0 because:
- I can't alter the DB.
- The origin table is in the data model so I think it's the reason why I'm not able to select a custom subtotal (Not sure, correct me if I'm wrong).
Any ideas?
Oh, also I'm open to use VBA.