The logical functions return information about values in an expression. For example, the TRUE function helps you to determine whether an expression that you are evaluating returns a TRUE value.
Following is the list of logical functions supported in Wyn Enterprise:
Description
The AND function checks whether both arguments are TRUE, and returns TRUE if both arguments are TRUE. Otherwise returns false. Checks whether both arguments are TRUE, and returns TRUE if both arguments are TRUE. Otherwise returns FALSE.
Syntax
AND(<logical1>,<logical2>)
Parameters
Return Value
Returns TRUE or FALSE depending on the combination of values that you test.
Example
AND('Sale'[SaleAmount]>100,'Product'[Name]="Wyn")
The IF function checks a condition and returns one value when it's TRUE, otherwise, it returns a second value.
IF(<logical_test>, <value_if_true>[, <value_if_false>])
Either value_if_true, value_if_false, or NULL.
IF('Sale'[Amount]>100, "High","Low")
The NOT function changes FALSE to TRUE, or TRUE to FALSE.
NOT(<logical>)
TRUE or FALSE.
NOT('Sale'[Amount] > 109)
The OR function checks whether one of the arguments is TRUE to return TRUE. The function returns FALSE if both arguments are FALSE.
OR(<logical1>,<logical2>)
A boolean value. The value is TRUE if any of the two arguments is TRUE; the value is FALSE if both the arguments are FALSE.
OR('Sale'[Amount]> 10,'Category'[Key]>1)
The SWITCH evaluates an expression against a list of values and returns one of the multiple possible result expressions.
SWITCH(<expression>, <value>, <result>[, <value>, <result>]…[, <else>])
A scalar value that comes from one of the result expressions, if there was a match with value, or from the else expression, if there was no match with any value.
SWITCH([Month], 1, "January", 2, "February", 3, "March", 4, "April", 5, "May", 6, "June", 7, "July", 8, "August", 9, "September", 10, "October", 11, "November", 12, "December", "Unknown month number" ) SWITCH(TRUE,'Sale'[Amount] < 100 ,"less",'Sale'[Amount]=100,"equal100","greater")