Forum Discussion

AnaCraig24's avatar
AnaCraig24
New Member
3 years ago
Solved

Help with a Dax Logic Query

Hello everybody!   I am writing to you because I need help with a query in Dax using the "If" logic function. Basically, I need to select some rows that meet various criteria to be able to particip...
  • Anonymous's avatar
    Anonymous
    3 years ago

    It looks like the issue is with the order of your logical operations. The way the query is currently written, the "Macro Group Enrollments" field must be greater than or equal to 10 and also blank, which is not possible.

     

    A possible solution is to move the "Macro Group Enrollments" comparison inside the parentheses, like this:

     

    Entitlement to Survey =

    IF ( [Type of study] = "Degree" && [Students enrolled] > 10 && [Cumulative teaching load of lecturer] > 10 && [Teaching load] = "S" && ( [Macro Group Enrollments] >= 10 || ([Macro group enrolments] = BLANK() && [Active Group] = "S") ), "Yes", "No" )

     

    This way, the query will check if the "Macro Group Enrollments" field is greater than or equal to 10, or if it is blank and the "Active Group" is "S".

    Also, you could make it more readable by separating the conditions on multiple lines and also make sure that the BLANK() function is applied to the correct field.