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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Diego-mx
Advocate I
Advocate I

Count TRUEs in filtered expression

This is a simple idea, but I can't figure out how to do it.  
I only need three columns in a table:   

object_id (int key), 
event_month (date), 
event_condition (logical)

Even if condition is FALSE, there may be a date.  

I just want to get the maximum count of conditioned objects based on date.  

Monthly_Max = MAXX( 
    KEEPFILTERS(VALUES([event_month])), 
    COUNTX(FILTER('Table', [event_condition] = TRUE()), 
[object_id])) )

But the second filter, doesn't respect the first filter.  
And I have tried other ways with CALCULATE with no success.  

I feel like this is gonna be easy, but I still need to get my head around it.  
Thanks 

 

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @Diego-mx,

 

You can create a measure below:

CountTrue = CALCULATE(COUNT(Table1[object_id]),FILTER(ALL('Table1'),'Table1'[event_condition]=TRUE()))

 

q1.PNG

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-qiuyu-msft
Community Support
Community Support

Hi @Diego-mx,

 

You can create a measure below:

CountTrue = CALCULATE(COUNT(Table1[object_id]),FILTER(ALL('Table1'),'Table1'[event_condition]=TRUE()))

 

q1.PNG

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors