![](https://ynteractive.com/wp-content/uploads/2023/02/c8bad1_9757df19984a46c4976e82b5d14d72ffmv2.png)
Let’s start with a simple example. Within a single calculation, all parts of a calculation must be either aggregated or not aggregated.
This calculation is not aggregated.
[Sales] / [Profit]
![](https://ynteractive.com/wp-content/uploads/2023/02/c8bad1_e92d6882c3b649cc8efd13dc4ae4188bmv2.png)
This calculation is aggregated.
Sum([Sales])/sum([Profit])
![](https://ynteractive.com/wp-content/uploads/2023/02/c8bad1_92ce6921b166479cbb60ec124a9df17dmv2.png)
Both of the calculations are valid. This calculation includes both aggregate, and non aggregated fields.
Sum([Sales]) / [Profit]
This calculation is not valid.
![](https://ynteractive.com/wp-content/uploads/2023/02/c8bad1_0a16d826b6c647a2b128f8a89806b6dcmv2.png)
It gets more complex when using other calculated fields in a second calculation. In this example, I created a field called “Sum of Sales” with this calculation. Sum([Sales]).
![](https://ynteractive.com/wp-content/uploads/2023/02/c8bad1_3bdf013d746d4c18bd25573780af84b9mv2.png)
If I use that field later, all other fields in the calculation must also be aggregated.
This calculation will be valid.
[Sum of Sales] / Sum([Profit])
Since [Sum of Sales] was already aggregated in a previous calculation, [profit] will also need an aggregation.
![](https://ynteractive.com/wp-content/uploads/2023/02/c8bad1_2823fc51f70943e1bf4ada010123ef8bmv2.png)
A few notes:
– Common aggregations include SUM, AVG, COUNT, MIN, MAX
– All Table calculations are aggregated
– Level of detail calculations using FIXED, INCLUDE, and EXCLUDE are not aggregated.