Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
RonaldT
New Member

Total of Measure

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?

RonaldT_0-1751615949064.png

 

1 ACCEPTED SOLUTION
AlexTheGreat
Resolver I
Resolver I

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!

View solution in original post

5 REPLIES 5
Natalie_iTalent
Administrator
Administrator

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

danextian
Super User
Super User

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.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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!

AlexTheGreat
Resolver I
Resolver I

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

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.