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
Teachers at a special needs school are evaluated based on the performance of their students. Here's how it works:
Problem: I need a formula that will only calculate a teacher's evaluation score IF at least half of her students have a letter grade. Otherwise, she would be evaluated as "Not Enough Information." Is there a DAX formula for this scenario. Sample data is below
| Average Grade | Evaluation Score |
| F | 1 |
| D | 2 |
| C | 3 |
| B | 4 |
| A | 5 |
| Teacher | Student | Average Grade |
| Ms. Johnson | James | A |
| Ms. Johnson | Molly | C |
| Ms. Johnson | Avery | A |
| Ms. Johnson | Jack | B |
| Ms. Johnson | Billy | No Grade |
| Ms. Johnson | Penny | A |
| Ms. Johnson | Scott | C |
| Ms. Johnson | Willow | No Grade |
| Ms. Johnson | Jennifer | A |
| Ms. Johnson | Thomas | No Grade |
| Mr. Allen | Grace | B |
| Mr. Allen | Aiden | No Grade |
| Mr. Allen | Tyler | A |
| Mr. Allen | Dallas | No Grade |
| Mr. Allen | Oliver | No Grade |
| Mr. Allen | Bailey | No Grade |
| Mr. Allen | Olivia | No Grade |
| Mr. Allen | Chris | A |
| Mr. Allen | Quinn | C |
| Mr. Allen | Alex | No Grade |
Solved! Go to Solution.
For my solution i would suggest merging the 2 tables into one. You can do this with the "Merge Queries" in Power Query. This would mean you should have two columns now, an Average Grade and Evaluation Score in your main table.
First we need a measure to figure out if a teacher should be considered:
Valid Data = VAR noGradeRows = CALCULATE(
COUNTROWS('YourTable'),
'YourTable'[Average Grade] = "No Grade"
)
VAR allRows = COUNTROWS('YourTable')
RETURN
DIVIDE(noGradeRows, allRows) <= 0.5 // This measure will return either TRUE or FALSE
Now we need a measure that calculates the average grade
Average Grade = CALCULATE(
AVERAGE('YourTable'[Evaluation Score]),
NOT 'YourTable'[Average Grade] = "No Grade"
)
From here, if you create a table visual, with the first column being the teacher and the last column being the following measure:
Teacher Grade = VAR selectedTeacher = SELECTEDVALUE('YourTable'[Teacher])
VAR validData = IF( // Does a check that only a single teacher is selected and that teacher has valid data
ISBLANK(selectedTeacher),
FALSE(),
[Valid Data]
)
VAR result = IF(
validData,
[Average Grade],
0
)
VAR output = SWITCH(
INT(result), // Round down the average grade
0, "Not Enough Information.",
1, "F",
2, "D",
3, "C",
4, "B",
5, "A"
)
RETURN
output
For my solution i would suggest merging the 2 tables into one. You can do this with the "Merge Queries" in Power Query. This would mean you should have two columns now, an Average Grade and Evaluation Score in your main table.
First we need a measure to figure out if a teacher should be considered:
Valid Data = VAR noGradeRows = CALCULATE(
COUNTROWS('YourTable'),
'YourTable'[Average Grade] = "No Grade"
)
VAR allRows = COUNTROWS('YourTable')
RETURN
DIVIDE(noGradeRows, allRows) <= 0.5 // This measure will return either TRUE or FALSE
Now we need a measure that calculates the average grade
Average Grade = CALCULATE(
AVERAGE('YourTable'[Evaluation Score]),
NOT 'YourTable'[Average Grade] = "No Grade"
)
From here, if you create a table visual, with the first column being the teacher and the last column being the following measure:
Teacher Grade = VAR selectedTeacher = SELECTEDVALUE('YourTable'[Teacher])
VAR validData = IF( // Does a check that only a single teacher is selected and that teacher has valid data
ISBLANK(selectedTeacher),
FALSE(),
[Valid Data]
)
VAR result = IF(
validData,
[Average Grade],
0
)
VAR output = SWITCH(
INT(result), // Round down the average grade
0, "Not Enough Information.",
1, "F",
2, "D",
3, "C",
4, "B",
5, "A"
)
RETURN
output
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 46 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |