Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 participate in a survey, and I need a "Yes" or "No" classification. The problem is that my query doesn't work for some rows, and I don't know why. The problem: when the "macro group enrollment" field is equal to or greater than 10, but the "enrolled students" field is less than 10, the row should be eligible, but it doesn't actually work.
This is how I have it:
Entitlement to Survey =
IF (
[Type of study] = "Degree"
&& [Students enrolled] > 10
&& [Cumulative teaching load of lecturer] > 10
&& [Teaching load] = "S"
&& (
[Macro Group Enrolments] >= 10
|| [Macro group enrolments] = BLANK ()
&& [Active Group] = "S"
),
"Yes",
"No"
)
I would be very grateful if any of you could help me to correct the query.
Thanks in advance
)
Solved! Go to Solution.
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.
Hello.
Fortunately, I was able to do it thanks to your advice. In the end, the problem was in the way the query was written, and I deleted the blank command. Again, thank you very much.
Thanks, 😀 I´ll check it out to see if works!
Hey, did this work for you? 🙂 If it did it'd really help me out if you could accept as solution! makes a big difference for me. Thanks!
Hope it worked, if not let me know maybe we can look at it 🙂
ello,
No, it is not working.😥 The problem persists. If "students enrolled" is less than 10, but in "macrogroups" I have more than 10 students, that line has to be "yes". Thanks, I'm still looking into it.
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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 36 | |
| 33 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |