Forum Discussion

NISH72's avatar
NISH72
Helper IV
6 years ago
Solved

Dax for multiple (and,or) statement

Hi can someone suggest dax for the following statement Sales value < 90 and either 3+ sales rating AND 4+ salesman OR 5+ sales rating AND 1+ salesman Actually I wanted to add a filter in power bi ...
  • Nathaniel_C's avatar
    6 years ago
    Sales value < 90 and either
    3+ sales rating AND 4+ salesman OR
    5+ sales rating AND 1+ salesman
    
    If(Sales value <90 && sales rating >=3 && salesman >=4 || Sales value <90 && sales rating >=5 && salesman >=1,1,0)

    Hi NISH72 ,
    If I understand what you are looking for you can use && and || .
    https://docs.microsoft.com/en-us/dax/dax-operator-reference 
    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
    Nathaniel

  • Greg_Deckler's avatar
    6 years ago

    You could do it with a FILTER like:

     

    VAR __table = 
      FILTER(
        Sales value < 90 && 
          ( Sales rating >= 3 && Salesman >= 4 || 
              Sales rating >= 5 && Salesman >= 1
          )
      )