Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
I'm struggling to find a method for Power BI to tell me how many (the total) records it has found that meet a filter condition:
"Present" is a percentage measure determined from the counts of presents and absents
I need either the total to say "5" or to create a new card that shows "5" for 100%
How to achieve this?
Solved! Go to Solution.
Hi,
I did have no insights in your data so I assumed that student[present] is a boolean (true/ false)
What I have done is:
Created a measure for % present in the classes.
Present % =
DIVIDE(
CALCULATE(SUM(Students[Present])),
CALCULATE(COUNTROWS(Students))
)
Created a measure where it counts the rows when the attendance is perfect (100%)
Total 100% Attendance Records =
CALCULATE(
COUNTROWS(
FILTER(
VALUES(Students[Name]),
[Present %] = 1
)
)
)
Let me know if it helps!
Dear community members,
A response that was unrelated to the original topic has been removed from this thread. We wanted to add this clarification as there are additional comments related to that comment shown.
Please feel free to reach out to me if you have any questions.
Best,
Natalie H.
Community Manager
I’m fine with using AI, but the response should be validated. This will actually throw a PLACEHOLDER error. You can’t directly filter a measure inside CALCULATE like that — it doesn’t know which rows or table context to apply the filter to.
Thank you for your valuable feedback and for pointing out the technical nuance regarding measures inside CALCULATE. You are absolutely right—filtering on a measure within CALCULATE doesn’t work as intended due to context limitations, and it’s important for the community to be aware of these subtleties in DAX.
I appreciate your attention to detail and your willingness to help maintain the quality of responses here. Discussions like this are what make our community stronger and more helpful for everyone.
Thanks again for your contribution!
Hi,
I did have no insights in your data so I assumed that student[present] is a boolean (true/ false)
What I have done is:
Created a measure for % present in the classes.
Present % =
DIVIDE(
CALCULATE(SUM(Students[Present])),
CALCULATE(COUNTROWS(Students))
)
Created a measure where it counts the rows when the attendance is perfect (100%)
Total 100% Attendance Records =
CALCULATE(
COUNTROWS(
FILTER(
VALUES(Students[Name]),
[Present %] = 1
)
)
)
Let me know if it helps!
Got it! I was missing the little parameter "VALUES" - it makes a massive difference. Thanks a mil
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 52 | |
| 39 | |
| 37 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 66 | |
| 34 | |
| 32 | |
| 29 |