Discussion Add calculation to Pivot Table with data from Field with Running %s in Excel
https://techcommunity.microsoft.com/t5/excel/add-calculation-to-pivot-table-with-data-from-field-with-running/m-p/1425341#M63960
<P>I have a PivotTable that contains info regarding transactions of different products, and how long each product usually takes to process. I have the product types as the rows of the table, and for the columns I have “Day Group,” or the number of days at or under which the transaction was processed. I have the dollar sum of the transactions as the underlying data, and since anything within 5 days was processed within 10 days, and anything in 10 days was processed in 14, etc., I have chosen “Show Values As % Running Total in Day Group,” so that the percentages accumulate over a product’s row. I’m interested in the difference in the amount of transactions processed within the first 60 vs. 14 days. I’d like to find the percent difference between these two thresholds for each product/row (so if 30% have been processed in 14 days and 90% have in 60, I want 60%, not 300% or 33.3%). Then I’d like to multiply that % by the sum of all sales for that product (I’ve pulled these from a different sheet but that can change). The % difference and some of the total sales numbers that they’re multiplied with can be seen in the first picture.</P><P> </P><P>I may not use Calculated Field and Calculated Item correctly. Thank you for bearing with me.</P><P> </P><P>The problem is that if I add a calculated item (so that I can make a formula subtracting ‘60’ from ‘40’) into the Day Group field, it thinks that that numbers in that column are the row’s total accumulated value, so the row’s other numbers are divided by it for their own percentages. You can see in the second image that leads to problems. I believe this is a problem no matter how you order the columns. I understand the reason for this problem is that since the difference column is part of the Day Group Field, the Field Settings forces the Difference Column values to be part of the running %. The column could possibly be made as its own Field so that I think it can have its own Field Settings, but then I don’t think it has access to the data in the Day Group Field.</P><P> </P><P>Currently, I have used normal formulas in cells off to the right, which you can see in the first image. This works with the current filters, but when those or anything else changes, it presents problems. Obviously it’d be ideal and more robust if I could incorporate this difference calculation directly into my PivotTable. If it’s also possible to not apply Field Settings to certain columns or Field Items, that could also work. Other things I’ve looked into are Slicers, PowerPivot, Macros/VBA, and other PivotTables. I wouldn’t immediately want to use these or another option if it wasn’t dynamic and able to change size and filters along with the original PivotTable. That’s the situation I’m already in with the cells off to the right.</P><P> </P><P>I’ve spent a ton of time on this. Thanks in advance for any help!</P>Thu, 28 May 2020 23:05:45 GMTjcarrigan2020-05-28T23:05:45ZAdd calculation to Pivot Table with data from Field with Running %s
https://techcommunity.microsoft.com/t5/excel/add-calculation-to-pivot-table-with-data-from-field-with-running/m-p/1425341#M63960
<P>I have a PivotTable that contains info regarding transactions of different products, and how long each product usually takes to process. I have the product types as the rows of the table, and for the columns I have “Day Group,” or the number of days at or under which the transaction was processed. I have the dollar sum of the transactions as the underlying data, and since anything within 5 days was processed within 10 days, and anything in 10 days was processed in 14, etc., I have chosen “Show Values As % Running Total in Day Group,” so that the percentages accumulate over a product’s row. I’m interested in the difference in the amount of transactions processed within the first 60 vs. 14 days. I’d like to find the percent difference between these two thresholds for each product/row (so if 30% have been processed in 14 days and 90% have in 60, I want 60%, not 300% or 33.3%). Then I’d like to multiply that % by the sum of all sales for that product (I’ve pulled these from a different sheet but that can change). The % difference and some of the total sales numbers that they’re multiplied with can be seen in the first picture.</P><P> </P><P>I may not use Calculated Field and Calculated Item correctly. Thank you for bearing with me.</P><P> </P><P>The problem is that if I add a calculated item (so that I can make a formula subtracting ‘60’ from ‘40’) into the Day Group field, it thinks that that numbers in that column are the row’s total accumulated value, so the row’s other numbers are divided by it for their own percentages. You can see in the second image that leads to problems. I believe this is a problem no matter how you order the columns. I understand the reason for this problem is that since the difference column is part of the Day Group Field, the Field Settings forces the Difference Column values to be part of the running %. The column could possibly be made as its own Field so that I think it can have its own Field Settings, but then I don’t think it has access to the data in the Day Group Field.</P><P> </P><P>Currently, I have used normal formulas in cells off to the right, which you can see in the first image. This works with the current filters, but when those or anything else changes, it presents problems. Obviously it’d be ideal and more robust if I could incorporate this difference calculation directly into my PivotTable. If it’s also possible to not apply Field Settings to certain columns or Field Items, that could also work. Other things I’ve looked into are Slicers, PowerPivot, Macros/VBA, and other PivotTables. I wouldn’t immediately want to use these or another option if it wasn’t dynamic and able to change size and filters along with the original PivotTable. That’s the situation I’m already in with the cells off to the right.</P><P> </P><P>I’ve spent a ton of time on this. Thanks in advance for any help!</P>Thu, 28 May 2020 23:05:45 GMThttps://techcommunity.microsoft.com/t5/excel/add-calculation-to-pivot-table-with-data-from-field-with-running/m-p/1425341#M63960jcarrigan2020-05-28T23:05:45ZRe: Add calculation to Pivot Table with data from Field with Running %s
https://techcommunity.microsoft.com/t5/excel/add-calculation-to-pivot-table-with-data-from-field-with-running/m-p/1425398#M63964
<P><LI-USER uid="682679"></LI-USER> Did you try using GETPIVOTDATA formula? you can call out multiple fields to pull out the specific values you want. Although multiple rows have the same names in the first col you show I'm sure there is another field that differentiates those groups.</P>Thu, 28 May 2020 23:58:35 GMThttps://techcommunity.microsoft.com/t5/excel/add-calculation-to-pivot-table-with-data-from-field-with-running/m-p/1425398#M63964mtarler2020-05-28T23:58:35ZRe: Add calculation to Pivot Table with data from Field with Running %s
https://techcommunity.microsoft.com/t5/excel/add-calculation-to-pivot-table-with-data-from-field-with-running/m-p/1425482#M63970
<P><LI-USER uid="570951"></LI-USER> I initially used GETPIVOTDATA for the table to the right, but I switched it to the hard cell references since those supported dragging the fill handle when different filters yield a different number of rows.</P>Fri, 29 May 2020 01:48:16 GMThttps://techcommunity.microsoft.com/t5/excel/add-calculation-to-pivot-table-with-data-from-field-with-running/m-p/1425482#M63970jcarrigan2020-05-29T01:48:16ZRe: Add calculation to Pivot Table with data from Field with Running %s
https://techcommunity.microsoft.com/t5/excel/add-calculation-to-pivot-table-with-data-from-field-with-running/m-p/1425536#M63974
<P><LI-USER uid="682679"></LI-USER> It would be easier to suggest a solution if you could upload your pivot table (just fake your numbers/product name for confidentiality) and also a Tab with a few row examples of what you want to finally achieve/show (i.e. correct output).</P>Fri, 29 May 2020 03:00:26 GMThttps://techcommunity.microsoft.com/t5/excel/add-calculation-to-pivot-table-with-data-from-field-with-running/m-p/1425536#M63974hynguyen2020-05-29T03:00:26ZRe: Add calculation to Pivot Table with data from Field with Running %s
https://techcommunity.microsoft.com/t5/excel/add-calculation-to-pivot-table-with-data-from-field-with-running/m-p/1425548#M63975
<P>Thanks <LI-USER uid="675276"></LI-USER> , I'll get on that ASAP. I'll provide one soon!</P>Fri, 29 May 2020 03:07:39 GMThttps://techcommunity.microsoft.com/t5/excel/add-calculation-to-pivot-table-with-data-from-field-with-running/m-p/1425548#M63975jcarrigan2020-05-29T03:07:39Z