Forum Discussion
DebiDomby
Jun 09, 2023Copper Contributor
Pivot Table with multiple grand total calculations
Hello, I'm trying to create a pivot table that has multiple total columns. I can get the totals, but it adds a column for Average and MIN (Best finish) to each FIN (finishing position) in the b...
SergeiBaklan
Jun 09, 2023Diamond Contributor
Afraid you can't to show few grand totals without showing the fields. As workaround, creating PivotTable you may add data to data model and create proper measure with combined Grand Total to use instead of initial fields.
Didn't catch how exactly your data is structured, thus on such sample
measure is
NewField :=
IF (
HASONEFILTER ( Table1[ID] ),
MAX ( Table1[B] ),
"Sum= "
& FORMAT (
SUM ( Table1[V] ),
"000"
) & "; Avr= "
& FORMAT (
AVERAGEA ( Table1[V] ),
"000.0"
)
)
DebiDomby
Jun 11, 2023Copper Contributor
One more question... Can you run macros on Pivot tables? That would be the best solution. Once you do it once, my columns never change. 26 is the most I'll have. That would be a great solution.
- SergeiBaklanJun 12, 2023Diamond Contributor
Yes, VBA works with PivotTable, but that's not my territory.
- DebiDombyJun 12, 2023Copper ContributorThanks... I'll try it. I never thought about recording a macro for it until now ... That'll actually solve my problem.