5 Replies Latest reply: Oct 23, 2015 6:10 PM by Bart Heijne

# Help with Formula to calculate total with conditions

Attached you find this dashboard

In the last graph I need an additional column. The calculation should be the sum of the red box in case of the first line.

This is the total amount of 'Team Cor' except where 'team cor' (linked to cost center of a project) <> team cor (linked to cost center of an employee).

How do I do that?

• ###### Re: Help with Formula to calculate total with conditions

Preparing examples for Upload - Reduction and Data Scrambling

• ###### Re: Help with Formula to calculate total with conditions

Jonathan, I already reduced the data using the 'reduce data - keep possible values' option.

• ###### Re: Help with Formula to calculate total with conditions

OK, but I suggest that you reduce it still further...

• ###### Re: Help with Formula to calculate total with conditions

I figured it out myself.

Solution:

=SUM(AGGR(IF([Projects CostCenterDescription]=[Employee CostCenterLabel],SUM(Total <[Employee CostCenterLabel]>[Projectactuals RealQuantityCosts] * [Item Sales Package Price])-SUM([Projectactuals RealQuantityCosts] * [Item Sales Package Price])),[Projects CostCenterDescription], [Employee CostCenterLabel]))

• ###### Re: Help with Formula to calculate total with conditions

I figured it out myself.

Solution:

=SUM(AGGR(IF([Projects CostCenterDescription]=[Employee CostCenterLabel],SUM(Total <[Employee CostCenterLabel]>[Projectactuals RealQuantityCosts] * [Item Sales Package Price])-SUM([Projectactuals RealQuantityCosts] * [Item Sales Package Price])),[Projects CostCenterDescription], [Employee CostCenterLabel]))