Functions can also be used inside the filters.

Example:

SUM(SALES WHERE PRODUCT(SALES, DISCOUNT) > PROFIT)

Here, PRODUCT is a function which returns PRODUCT of SALES and DISCOUNT.The filter WHERE PRODUCT(SALES,DISCOUNT) > PROFIT is applied on SALES