Active Member
December 4, 2019
I have a large table that has multiple types of material properties (yield strength, ultimate strength, compressive strength, shear strength, elongation, etc.) as well as multiple input criteria (floor level, type of masonry, type of stone, type of steel, type of steel shape, building area). I would like to build a pivot table to calculate certain properties on the filtered data that are broken down by one of the categories (for example, floor level). I would like to have columns for average, standard deviation, max, min, coefficient of variation, etc.
1) Is there a way to change the property that is summarized in the pivot table for all columns? As it stands, I can add the column for, for example, Yield Strength as many times as I want, then change the Summary Function (to average, max, min, etc.). However, if I want to then have the pivot table report on the Ultimate Strength of the data set, I have to change each column individually. I'd like to be able to change between properties (Yield Strength, Ultimate Strength, etc.) with a single change, without having to update each column to change it from Yield Strength to Ultimate Strength.
2) I would like to add a columun that will calculate the coefficient of variation (COV) of the displayed data. The COV is the standard deviation divided by the average. I can do this outside the pivot table, but if the pivot table changes height (for example, if I change the rows from Building Area to Floor Level, which have different numbers of options), then the formulas do not work since they reference empty cells. There are possibly other formulas I would like to add as well.
I'm very new to Pivot Tables, so thank you for your patience!
July 16, 2010
Hi Matthew,
Welcome to our forum!
It sounds like you need to unpivot your data so that the 'Material Properties' are in a single column and the value is in another column. This will allow you to use Slicers to change between the properties and only need to set the different summary functions once. You can easily unpivot the data with Power Query.
In regards to your COV calculation, you can do this with Power Pivot measures, but I'm not sure you can do it with the regular PivotTable calculated fields.
If you get stuck, upload a sample Excel file and we can help you further.
Mynda
Active Member
December 4, 2019
Hi Mynda
Thank you for the reply! I think I get what you are suggesting. However, for my data set, I have some entries that have a value in multiple (up to maybe 10) different property types, so I cannot simply have a column that includes the name of the property as an entry and a second column for the numerical value, for each line in the data. I suppose this would work if I assigned a primary, secondary, etc. property type for each type of data, but this would be very prone to error since the data would have to be entered in the same order for all similar entries. There are also about 28 property types (i.e., different types of results values) right now, and this will definitely increase!
I have uploaded a much smaller version of the data and pivot table that I am trying to work with. It has 4 Input Criteria (Area, Flooor, Zone, and Shape) and 6 Property Types (Yield strength, Ultimate strength, Elongation, Total Carbon, Carbon Equivalent, and Weldability). Each of the 12 entries in the data source has values for all of these Criteria and Property values. I have applied filter controls using slicers and linked Pivot Tables for convenience and consistency of display (slicers are on a separate sheet, with secondary pivot tables that act as filter controls on the primary sheet). My computer is set up in French, so hopefully translates back to English when you open it on your machine (usually not a problem).
I can get the main pivot table to display the sum, average, max, min, etc. (using the built-in summary function options) for one of the properties, but would like to not have to create new columns reporting these summary values for each of the other 5 property types, which would be prone to error (and would be time-consuming when I go back to the main data source which has 28 property types).
With regards to the COV calculation, I think I have figured out how to do this with Measures/Power Pivot but only for one specific property (i.e., only for Yield Strength), not for the generic "Values" of a specific material property which I want to be able to select in order to retain flexibility.
I very much appreciate the help! Hopefully someone has a suggestion that will work.
Best regards,
Matt
July 16, 2010
Hi Matthew,
Thanks for sharing the file. You can use this Power Pivot technique that allows you to change aggregation methods using Slicers.
It requires a version of Excel that comes with Power Pivot.
Mynda
Active Member
December 4, 2019
Hi Mynda
Thanks for the reply. I don't see how this can work in my situation: the Measures that were created in the example were for a specific column in the original data set, "Sales" (i.e., Sales Prior Period, Sales Current Period). I want to display the same calculations (average, min, max, etc.) but on a variable Property type that can be changed by selecting from a list/filter, without having to create the same list of custom Measures for each Property.
Thanks for the help!
July 16, 2010
Hi Matthew,
You would need to set up the measures first. Going back to my original suggestion now that I have your sample data. I don't see why you're concerned about errors if you unpivot your data so you have a Property Type column and a value column. Power Query can connect to your table and unpivot the data. If you make changes to the original source data, you just refresh the query and it updates.
See example attached.
Mynda
Answers Post
Active Member
December 4, 2019
Hi Mynda
Thanks so much for your help. I got my spreadsheet working how I would like. I was very reluctant to unpivot the data, prior to discovering that unpivoting makes a new table but leaves the existing one in place. Data entry into the original table (which is ongoing) is much easier when all values are on the same line for a given specimen. But now that I've unpivoted, the Pivot Table works like a charm. I've also noted that by placing my Property (i.e., the different types of values that I have) column ahead of the Values in the Columns area of the Pivot Table, I can display all the calculations (Avg, Std. Dev, Coefficient of Variation, etc.) on multiple related properties at the same time.
A whole new world has opened it's doors to me!
Thanks fo much for your assistance and patience.
1 Guest(s)