Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate % of a Row Grand Total

Status
Not open for further replies.

mejiaks

IS-IT--Management
Jun 9, 2003
131
HN
I am stuck here with a Pivot Table

if you see the image
Business center and Month are Rows

Rev, Exp are the type of values where USD Amount is sum

The Gran total is the automatic Total that the pivot table add.

What i need is to have another Column to show the % of the Gran Total against Rev Column
in "a" for example, the ne column should show 50% (5/10)
can this be done?

with out modifying the data source, cause is coming from sql

unnamed_jacg7e.png
 
Hi,

I would change your method thusly:

1) Make your query directly to the database, via Microsoft Query (Data > get external data > From other sources > From Microsoft Query... The data will reside on a sheet as a Structured Table, rather than a Pivot Table, but the data can be pivoted via SQL like this...
Code:
Transform Sum([USD Amount])
Select [Business Center], [month]
From YourSQL_Table
Where [month] = 10
Group By [Business Center], [month]
Pivot [Item]
Then the additional column is a simple quotient formula...
[tt]
=[@Total]/[@Rev]
[/tt]

The result
[pre]
Business Center month Rev Exp Total Total % of Rev

a 10 10 -5 5 0.5
b 10 100 -33 67 0.67
[/pre]




Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Instead of automatic Grand Total you can use two calculated fields, one for Total: =Rev+Exp, secpnd for% of Rev: =(Rev+Exp)/Rev. Pivot table sums fields in domain and calculates formulas.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top