# Calculations for Total

I am looking to Divide a field by the total. Example: So the total should not take in the dimensions in the visual. I tried creating a calculated field that filters for selective dimensions but not all in the sheet/analysis. So, looking to calculate total of for example. lets say I have a column called Subject, and another column called MArks/score. Now I am trying to create a calc field that will do the sum of Marks for all subjects. I tried SUM OVER and it is not helping.

To divide a field by the total, you can use the QuickSight aggregation function called â€śTOTAL.â€ť The â€śTOTALâ€ť function allows you to calculate the sum of a field across all dimensions in a visualization, ignoring any dimension-based filtering or grouping.

To calculate the total of the â€śMarks/scoreâ€ť column for all subjects, you can create a calculated field using the following formula:

SUM(Marks) / TOTAL(SUM(Marks))

Hereâ€™s how you can create this calculated field:

1. Open your analysis or sheet in QuickSight.
2. Click on the â€śDataâ€ť pane on the left-hand side.
3. Under the â€śFieldsâ€ť section, click on the â€ś+â€ť button to create a new calculated field.
4. In the formula editor, enter the formula mentioned above: `SUM(Marks) / TOTAL(SUM(Marks))`.
5. Provide a name for your calculated field, such as â€śMarks Total Ratio.â€ť
6. Click â€śCreateâ€ť or â€śSaveâ€ť to create the calculated field.

Now, you can use this calculated field in your visualizations. It will display the ratio of the sum of marks for each subject to the total sum of marks across all subjects, regardless of any dimensions in the visualization.

Please note that the â€śTOTALâ€ť function calculates the sum across all dimensions, so if you have any filters applied at the dataset or analysis level, they will still be considered in the total calculation. However, any filters or dimensions applied within the visualization will not affect the total calculation.

I hope this helps!

1 Like

Hope you are able to resolve the problem with the solution provided by @Blenner .
I am marking the reply as â€śSolution,â€ť but let us know if this is not resolved.

Thanks for posting your questions on the QuickSight CommunityQ&A Forum!

Hi, in quicksight, I could not find the aggregation function called â€śTotalâ€ť. Could you kindly share where I could find it?