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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
nnn123
Regular Visitor

including filters/clauses into count formula

Hi,

 

I am trying to write a formula for a new column or measure that counts rows in a table but with conditions: 

 

e.g. to count rows in TABLE1 where TABLE1[column1]='Red'.

 

what is the best way to do this please? Tried the countrows and countx function but no success

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

HI @nnn123

 

Try

 

Measure =
CALCULATE ( COUNTROWS ( Table1 ), Table1[Column1] = "Red" )

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

HI @nnn123

 

Try

 

Measure =
CALCULATE ( COUNTROWS ( Table1 ), Table1[Column1] = "Red" )

That's great thank you Zubair!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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