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 September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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