Percentage of Grand Total in Row

TH123

New Member
Joined
Nov 15, 2022
Messages
30
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have data like below and I create pivot table accordingly. I want to add percentage as row directly as row#8 which I manually calculate in pivot table with logic: each column data multiple Grand total in column.
Thank you.



Data source
Book1
ABCD
1IssueItemQuantityDays Diff
2Late addedA10000
3Late addedB5007
4Late addedC20014
5Fab issueD40021
Sheet1


PIvot table
Book1
HIJKLMN
1Sum of QuantityDays Diff
2IssueItem071421Grand Total
3Fab issueD400400
4Late addedA10001000
5B500500
6C200200
7Grand Total10005002004002100
8%48%24%10%19%100%
Sheet1
Cell Formulas
RangeFormula
J8:N8J8=J7/$N$7
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
You'd have to add the Quantity field again and show it as % of row total, then either hide the additional rows within the pivot table, or load it to the data model and create a row set to only show it at the Grand total level.
 
Upvote 0
You'd have to add the Quantity field again and show it as % of row total, then either hide the additional rows within the pivot table, or load it to the data model and create a row set to only show it at the Grand total level.
Hi RoryA,

Thanks for sharing comments. Yes, I've tried before but new adding is column as chart below, not row as my 1st chart. What I want is adding new row to show % of each column vs G.Total.

Book1
HIJKLMNOPQRS
1ValuesDays Diff
2Sum of QuantitySum of Quantity2Total Sum of QuantityTotal Sum of Quantity2
3IssueItem071421071421
4Fab issueD4000.00%0.00%0.00%100.00%400100.00%
5Late addedA1000100.00%0.00%0.00%0.00%1000100.00%
6B5000.00%100.00%0.00%0.00%500100.00%
7C2000.00%0.00%100.00%0.00%200100.00%
8Grand Total100050020040047.62%23.81%9.52%19.05%2100100.00%
Sheet1


1736241881884.png

1736241957079.png
 
Upvote 0
Formatting is not as good, but if you have the PIVOTBY function, could you use a formula approach something like this?

25 01 07.xlsm
ABCDEFGHIJKLMN
1IssueItemQuantityDays Diff 071421Total
2Late addedA10000Fab issueD400400
3Late addedB5007Late addedA10001000
4Late addedC20014Late addedB500500
5Fab issueD40021Late addedC200200
6Total10005002004002100
7%0.480.240.10.191
PT
Cell Formulas
RangeFormula
H1:N7H1=LET(d,A2:D5,q,INDEX(d,0,3),p,PIVOTBY(TAKE(d,,2),TAKE(d,,-1),q,SUM),VSTACK(p,MAKEARRAY(1,COLUMNS(p),LAMBDA(r,c,IF(c=1,"%",IF(c>2,ROUND(INDEX(p,ROWS(p),c)/SUM(q),2),""))))))
Dynamic array formulas.



If those last row percentages are not to be used in other calculations we could make them text so they look better.

25 01 07.xlsm
ABCDEFGHIJKLMN
1IssueItemQuantityDays Diff 071421Total
2Late addedA10000Fab issueD400400
3Late addedB5007Late addedA10001000
4Late addedC20014Late addedB500500
5Fab issueD40021Late addedC200200
6Total10005002004002100
7%48%24%10%19%100%
PT (2)
Cell Formulas
RangeFormula
H1:N7H1=LET(d,A2:D5,q,INDEX(d,0,3),p,PIVOTBY(TAKE(d,,2),TAKE(d,,-1),q,SUM),VSTACK(p,MAKEARRAY(1,COLUMNS(p),LAMBDA(r,c,IF(c=1,"%",IF(c>2,TEXT(INDEX(p,ROWS(p),c)/SUM(q),"0%"),""))))))
Dynamic array formulas.
 
Upvote 0
Hi RoryA,

Thanks for sharing comments. Yes, I've tried before but new adding is column as chart below, not row as my 1st chart. What I want is adding new row to show % of each column vs G.Total.
You need to move the Values field to the Row area, not the Column area in the field list:

1736244675352.png
 
Upvote 0
Solution
You need to move the Values field to the Row area, not the Column area in the field list:

View attachment 121025
Appreciated yoru support . Finally I can archive what I want with your support. Could you please show me result of "load it to the data model and create a row set to only show it at the Grand total level"? I have load it to the data model in pivot table however don't know how to create a row set to only show it at grand total level. I still need to hide the row manually.
 
Upvote 0
Formatting is not as good, but if you have the PIVOTBY function, could you use a formula approach something like this?

25 01 07.xlsm
ABCDEFGHIJKLMN
1IssueItemQuantityDays Diff 071421Total
2Late addedA10000Fab issueD400400
3Late addedB5007Late addedA10001000
4Late addedC20014Late addedB500500
5Fab issueD40021Late addedC200200
6Total10005002004002100
7%0.480.240.10.191
PT
Cell Formulas
RangeFormula
H1:N7H1=LET(d,A2:D5,q,INDEX(d,0,3),p,PIVOTBY(TAKE(d,,2),TAKE(d,,-1),q,SUM),VSTACK(p,MAKEARRAY(1,COLUMNS(p),LAMBDA(r,c,IF(c=1,"%",IF(c>2,ROUND(INDEX(p,ROWS(p),c)/SUM(q),2),""))))))
Dynamic array formulas.



If those last row percentages are not to be used in other calculations we could make them text so they look better.

25 01 07.xlsm
ABCDEFGHIJKLMN
1IssueItemQuantityDays Diff 071421Total
2Late addedA10000Fab issueD400400
3Late addedB5007Late addedA10001000
4Late addedC20014Late addedB500500
5Fab issueD40021Late addedC200200
6Total10005002004002100
7%48%24%10%19%100%
PT (2)
Cell Formulas
RangeFormula
H1:N7H1=LET(d,A2:D5,q,INDEX(d,0,3),p,PIVOTBY(TAKE(d,,2),TAKE(d,,-1),q,SUM),VSTACK(p,MAKEARRAY(1,COLUMNS(p),LAMBDA(r,c,IF(c=1,"%",IF(c>2,TEXT(INDEX(p,ROWS(p),c)/SUM(q),"0%"),""))))))
Dynamic array formulas.
Thank you for your attention on this matter. While this is a good way to address my expectation, I found another solution from RoryA that better fits my question.
 
Upvote 0
Thank you for your attention on this matter. While this is a good way to address my expectation, I found another solution from RoryA that better fits my question.
You're welcome. No problem at all, glad you have been able to achieve what you want. Thanks for the follow-up though. :)
 
Upvote 0
Once you have the pivot table, you can create the row set:
1736340162078.png


Then in the next dialog, just delete the rows you don't want visible:
1736340280483.png

Note that if you need it to be dynamic (i.e. if the values in the row fields will change) then you will need to create a measure for the Quantity percent and also edit the MDX for that set, which is a little more complicated.
 
Upvote 0
Once you have the pivot table, you can create the row set:
View attachment 121065

Then in the next dialog, just delete the rows you don't want visible:
View attachment 121066
Note that if you need it to be dynamic (i.e. if the values in the row fields will change) then you will need to create a measure for the Quantity percent and also edit the MDX for that set, which is a little more complicated.
Thanks for your kind explanation. I've tried to delete the row as same as your provided image however the result show no sum of quantity 2 in total. Could you please help to review and share comments?
FYI: I've tried to click into drop box at all the row with values equal to "Sum of quantity 2" => this value change to "Sum of quantity" automaticially.
1736343606843.png
1736343937776.png
1736343479525.png
 

Attachments

  • 1736343854967.png
    1736343854967.png
    5.6 KB · Views: 1
Upvote 0

Forum statistics

Threads
1,225,477
Messages
6,185,218
Members
453,283
Latest member
Shortm88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top