Pivot Table Calculations

xxthegiantxx

New Member
Joined
Jan 5, 2017
Messages
24
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Material[/TD]
[TD]Apr Volume[/TD]
[TD]Price[/TD]
[TD]April revenue[/TD]
[TD]May Volume[/TD]
[TD]Price[/TD]
[TD]May Revenue[/TD]
[TD]Volume Total[/TD]
[TD]Total Revenue[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]X[/TD]
[TD]10[/TD]
[TD]1.00[/TD]
[TD]10.00[/TD]
[TD]5[/TD]
[TD]1.00
[/TD]
[TD]5.00[/TD]
[TD]15[/TD]
[TD]15.00[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Y[/TD]
[TD]1[/TD]
[TD]2.00[/TD]
[TD]2.00[/TD]
[TD]2[/TD]
[TD]2.00[/TD]
[TD]4.00[/TD]
[TD]3[/TD]
[TD]6.00[/TD]
[/TR]
</tbody>[/TABLE]

I am using a pivot table in which total monthly volumes are calculated. I am trying to get the pivot table to automatically calculate the total revenues (green letters) by multiplying the price times monthly volume. The price does not change. Therefore, i don't think i can have a row in the table with the price. I tried this using a vlookup formula to add price when a material is selected but the pivot table calculates the sum of these or avg. etc.
How do i
1. add a row in my pivot chart for the price
2. add a row that multiplies price time volume monthly to get me a grand total
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
You can add a calculated field that performs that multiplication.
Caution, that may not provide a valid Column calculation, but will work for the row calculation.
 
Upvote 0
Spiller, can you give more detail on how to do that? From what i know, calculated fields only work if the item is a column in the pivot table. Price does not change. If i add it to the table as a column that uses vlookup to pull the price when a material in the column is detected, the pivot table will calculate the price as a sum, average, etc. This does not allow me to do an accurate calculation. In other words, using the table above, it should calculate B x C= D. Instead, C becomes a sum of all the data series with Material 'X'. Price does not remain unchanged.
 
Last edited:
Upvote 0
Spiller, can you give more detail on how to do that? From what i know, calculated fields only work if the item is a column in the pivot table. Price does not change. If i add it to the table as a column that uses vlookup to pull the price when a material in the column is detected, the pivot table will calculate the price as a sum, average, etc. This does not allow me to do an accurate calculation. In other words, using the table above, it should calculate B x C= D. Instead, C becomes a sum of all the data series with Material 'X'. Price does not remain unchanged.

It is not a concern for each row. At the Grand Total and Subtotal Rows it would be. There are DAX methods to get around those issues but I am only aware of and not knowledgeable in DAX.

The other route is to provide the calculation in the source data. For small data sets that's easy, but a bad habit when getting into large (ie millions of rows) data sets. But those data sets will force PowerPivot and DAX solutions anyway. (see Rob Collie, PowerPivotPro.com and Ken Puls https://www.powerquery.training/about-us/)
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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