The If() function is useful in extending the functionality and flexibility of calculations in reports so that they behave more dynamically.
The syntax for using the If() function to modify the behavior of calculations is:
=If([object name] = "true value" ; [measure] behavior A ; [measure] behavior B)
=If [object name] = "true value" Then [measure] behavior A Else [measure] behavior B
In other words, if the value returned by an object is equal to what is specified in quotes, then the calculation should behave in a certain manner, otherwise the values should be calculated in a different manner.
See the following video to learn more about creating a query.