1 of 1 people found this helpful
You are mixing aggregate and non-aggregate functions.
I can make some suggestions on how to fix this, but it would be best if I knew what you were trying to do.
One possibility is to first add a filter on [Order Date], and then leave your IF statement as If CountD(Customer)>=80 Then SUM([Sales])/2 END.
Another possibility is to introduce an aggregation on the date as well: If CountD(Customer)>=80 AND Year(MAX([Order Date])) = [Year Parameter] Then SUM([Sales])/2 END
Clearly the 2 approaches will give you 2 different results - try them out and see what suits your needs.
You can read this KB article for more insight: Resolving "Cannot mix aggregate and non-aggregate arguments" Calculation Error | Tableau Software
Let me know if you have more questions - I'd be glad to help. If you provide sample data and/or workbook, and state what you are trying to achieve, that would even be better.