Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).
Checks whether both arguments are TRUE, and returns TRUE if both arguments are TRUE. Otherwise returns false.
The following formula shows the syntax of the AND function.
=IF(AND(10 > 9, -10 < -1), "All true", "One or more false"
Because both conditions, passed as arguments, to the AND function are true, the formula returns "All True".
The following sample uses the AND function with nested formulas to compare two sets of calculations at the same time. For each product category, the formula determines if the current year sales and previous year sales of the Internet channel are larger than the Reseller channel for the same periods. If both conditions are true, for each category the formula returns the value, "Internet hit".
Bottles and Cages
Tires and Tubes
= IF( AND( SUM( 'InternetSales_USD'[SalesAmount_USD]) >SUM('ResellerSales_USD'[SalesAmount_USD]) , CALCULATE(SUM('InternetSales_USD'[SalesAmount_USD]), PREVIOUSYEAR('DateTime'[DateKey] )) >CALCULATE(SUM('ResellerSales_USD'[SalesAmount_USD]), PREVIOUSYEAR('DateTime'[DateKey] )) ) , "Internet Hit" , "" )