Forum Discussion

JK-1's avatar
JK-1
Helper II
1 year ago
Solved

Multiple IF, AND conditions

Struggling with learning some of the basics and have researched online too but finding it hard to unravel. Grateful for any assistance in trying to formulate the below, columns 6 to 9.  Thanks in adv...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi JK-1,

    Thank you for reaching out in Microsoft Community Forum.

    The only issue with the formula you posted is a small syntax error in the IF condition. In DAX, all conditions need to be separated by logical operators like &&, and each condition must return a TRUE/FALSE result.

    please use the below DAX to resolve the error;

    OnFlagCC =
    IF (
    SubsidyData[StoreNumber] = 83 &&
    CONTAINSSTRING(SubsidyData[Leader], "ON") &&
    SubsidyData[Subsidy] >= -100 &&
    SubsidyData[Subsidy] <= 100,
    1,
    0
    )

    Please continue using Microsoft Community Forum.

    If this post helps in resolve your issue, kindly consider marking it as "Accept as Solution" and give it a 'Kudos' to help others find it more easily.

    Regards,
    Pavan.