Logical functions perform basic logical operations on input data obtained from various data-sources.
In the sample below are listed all supported logical functions:
equal, not-equal, greater-or-equal, greater, less, less-or-equal, and, or.
Examples:
1. The following sample illustrates the use of the equal, not-equal, greater and less functions.
This functions compare the first input parameter (op1) with the second input parameter (op2). The output is a boolean value.
The output displays the departments in which every employee worked, the hours worked and compares them with the number "300". If the hours worked equal 300, do not equal 300, are greater than 300 or less than 300: return "true, otherwise return "false".

Note. This sample can be found in LogicalFunctions1.dax from Samples\Job Samples folder.
OUTPUT:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns:root xmlns:ns="http://www.tempuri.org/XML">
<ns:hist department="Accounting" hours-worked="300" equals-300="true" not-equals-300="false" greater-than-300="false" less-than-300="false"/>
<ns:hist department="Sales" hours-worked="500" equals-300="false" not-equals-300="true" greater-than-300="true" less-than-300="false"/>
<ns:hist department="Accounting" hours-worked="1000" equals-300="false" not-equals-300="true" greater-than-300="true" less-than-300="false"/>
<ns:hist department="Sales" hours-worked="8000" equals-300="false" not-equals-300="true" greater-than-300="true" less-than-300="false"/>
<ns:hist department="Development" hours-worked="3000" equals-300="false" not-equals-300="true" greater-than-300="true" less-than-300="false"/>
<ns:hist department="Development" hours-worked="5000" equals-300="false" not-equals-300="true" greater-than-300="true" less-than-300="false"/>
<ns:hist department="Accounting" hours-worked="100" equals-300="false" not-equals-300="true" greater-than-300="false" less-than-300="true"/>
</ns:root>
2. The following example illustrates the use of the and and or functions.
These functions have two input parameters named op1 and op2 that must be boolean values. These values are evaluated using the corresponding logical function. The output is a boolean value as well.
Function "and" is used to check if the average hours worked are greater or equal than 2500 and less or equal than 2600. In that case it returns "true", otherwise it returns "false".
Function "or" is used to check if the average hours worked are greater or equal than 2500 or less or equal than 2600. In that case it returns "true", otherwise it returns "false".

Note. This sample can be found in LogicalFunctions2.dax from Samples\Job Samples folder.
OUTPUT:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns:root average-hours-worked="2557" between-2500-and-2600="true" not-between-2500-and-2600="true" xmlns:ns="http://www.tempuri.org/XML"/>