Forum Discussion
How to calculate percentage of a summed column against another tables values
To calculate the percentage of TEU loaded against the capacity of each route in your pivot table, you can create calculated fields or measures.
Here is how you can do it:
- Ensure that you have a relationship established between your raw data table and the table containing the TEU capacity for each route. Make sure the "routes" column is properly linked in both tables.
- In your pivot table, right-click on any cell in the "Values" section and choose "Value Field Settings" or "Field Settings" (depending on your Excel version).
- In the "Value Field Settings" dialog, select the "Sum TEU loaded" field (or the field that represents the sum of TEU loaded) and click on the "Value Field Settings" button.
- In the "Value Field Settings" dialog, select the "Show Values As" tab.
- From the list of options, choose "% of Grand Total". This will calculate the percentage of TEU loaded relative to the grand total of all routes.
- Click "OK" to close the dialogs. Now, the "Sum TEU loaded" column in your pivot table will show the percentage of TEU loaded for each route.
- To calculate the utilization percentage, you will need to create a new calculated field or measure based on the TEU capacity for each route.
- Go to the table containing the TEU capacity for each route, and create a new calculated field or measure that calculates the utilization percentage. You can do this by dividing the sum of TEU loaded by the TEU capacity and multiplying by 100.
- Once you have the utilization percentage calculated, bring this field or measure into your pivot table, ensuring it is associated with the respective routes.
- Format the newly added fields or measures as percentages in your pivot table if needed.
By following these steps (created with the help of AI), you should be able to calculate the percentage of TEU loaded against the capacity of each route and the utilization percentage in your pivot table.
- jonskoglandMay 25, 2023Copper Contributor1. I think I've done this correctly. Although the TEU capacity field is summed for each row in the pivot table for some reason, instead of displaying the route specific capacity.
2. an 3. I've already done this.
4. and 5. This is not what I'm looking for, as I need to calculate the percentage of the capacity used for each individual trip made, not in relation to other trips.
6. same as 4 and 5
7. - 8. It calculates a percentage, but this percentage is of the sum of the capacity for all routes, instead of filtering the capacity for each row. The same capacity of 230 is thus used to calculate the perentage for all rows, instead of filtering for each individual row and changing capacity based on the route shown in the left most row.
9. can't do this yet.- NikolinoDEMay 25, 2023Gold Contributor
To calculate the percentage of each date's sum of TEU loaded against the capacity of each route in your pivot table and find the utilization percentage, you can follow these steps:
- Make sure you have established the relationships between the "routes" column in your raw data table and the table containing the TEU capacity for each route.
- In your pivot table, add the following fields to the "Values" area:
- "Sum TEU loaded" (sum of TEU loaded per date and route)
- "TEU Capacity" (capacity of each route)
- Right-click on the "Sum TEU loaded" field in the pivot table and select "Value Field Settings" or "Field Settings" (depending on your Excel version).
- In the "Value Field Settings" dialog, choose "Show Values As" and then select "% of Parent Row Total." This will calculate the percentage of TEU loaded against the sum of TEU loaded for each date.
- Click "OK" to close the dialog. Now, the "Sum TEU loaded" field in your pivot table will display the percentage of TEU loaded for each date relative to the total sum of TEU loaded for that date.
- Right-click on the "TEU Capacity" field in the pivot table and select "Value Field Settings" or "Field Settings."
- In the "Value Field Settings" dialog, choose "Show Values As" and then select "% of Parent Row Total." This will calculate the percentage of TEU capacity against the sum of TEU capacity for each date.
- Click "OK" to close the dialog. Now, the "TEU Capacity" field in your pivot table will display the percentage of TEU capacity for each date relative to the total sum of TEU capacity for that date.
- Add the "Empty Wagon" and "Trailers" fields to the "Values" area of the pivot table.
- Create a calculated field called "TEU in total" that sums the TEU loaded and the empty TEU capacity for each date. The formula for this calculated field would be something like:
TEU in total = [Sum TEU loaded] + [Empty Wagon]
- Create another calculated field called "Utilization %" that calculates the percentage of TEU loaded against the TEU in total for each date. The formula for this calculated field would be:
Utilization % = [Sum TEU loaded] / [TEU in total] * 100
- Format the calculated fields as percentages if needed.
With these steps, you should have the desired columns in your pivot table: "TEU in total," "TEU Loaded %," "TEU empty %," "Trailers," "TEU space," and "Utilization %." The "TEU Loaded %" column will show the percentage of TEU loaded against the TEU in total for each date, and the "Utilization %" column will display the utilization percentage for each date based on the TEU loaded and the empty TEU capacity. In the heat of the moment and the lack of time, this text was created with the help of AI.
- jonskoglandMay 25, 2023Copper ContributorThere might be some issues with the connection between my two tables then