Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Urgent- Multiple OR function with CALCULATE

Hello Everyone,
 
I am trying to create a measure with the Calculate function. 
 
The requirement is to get the [# target] where 'Products Identifier'[Attribute Identifier] = "innos" AND 'Products Identifier'[Attribute Value] = "YES" OR 'Products Identifier'[Attribute Identifier]="msl_gm" AND 'Products Identifier'[Attribute Value] = "YES" OR Products[ManualFile Category] = "IMP" 
 
Please find below how I am trying to frame the DAX;
 
FlagTest = CALCULATE(Audits[# targeted], 'Products Identifier'[Attribute Identifier] = "innos", 'Products Identifier'[Attribute Value] = "YES" ||
'Products Identifier'[Attribute Identifier]="msl_gm",'Products Identifier'[Attribute Value] = "YES" ||
Products[ManualFile Category] = "IMPULSE")
 
NB: the Products[ManualFile Category] = "IMP" is totally in a different table and also the connection type is Live connection. Please, how can I achieve this with DAX?
Any comments, suggestions and solutions will be highly appreciated.
 
Kind regards; Nick

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, where you want to use AND put "&&" instead. 

    Another possible soultion would look like:
    FlagTest = Calculate(Sum(Audits[#targeted]),
    FILTER(Products Identifier,'Products Identifier'[Attribute Identifier] = "innos" && 
     'Products Identifier'[Attribute Value] = "YES" ||
    'Products Identifier'[Attribute Identifier]="msl_gm" &&
    'Products Identifier'[Attribute Value] = "YES" ||
     Products[ManualFile Category] = "IMP"


    I wrote that free-hand so I wouldn't trust that it is fully functioning, but I hope it is a step in the right direction.