Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
In my recent quest to create or catalog as many DAX equivalents for Excel functions, here's an obvious one missing from DAX's logical functions library, the ever popular XOR.
XOR =
VAR __Logical1 = MAXA([Logical1])
VAR __Logical2 = MAXA([Logical2])
VAR __Table = { CONVERT(__Logical1, BOOLEAN), CONVERT(__Logical2, BOOLEAN) }
VAR __TrueRows = COUNTROWS(FILTER(__Table,[Value] = TRUE()))
RETURN
IF(ISEVEN(__TrueRows),FALSE,TRUE)
I have structued this so that it can be easily extended to support any number of logical "input" arguments. Essentially, just add as many items to __Table as desired.
eyJrIjoiZjhhYzFkOTctYTNjOC00OGViLWI1MTItZjI1MWFkN2Y4MDA1IiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9