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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

How to count if

Hello good, sorry anyone knows how I can perform the text count "yes", in a column containing "yes" and "no"?

5 REPLIES 5
Syndicate_Admin
Administrator
Administrator

I hope this will be useful to you. Good luck! 🙂

Syndicate_Admin
Administrator
Administrator

This measure uses the FILTER function to select only the rows in the specified column that contain the text "if". The COUNTROWS function then counts the number of resulting rows, which will give you the "if" text count in that column.

Syndicate_Admin
Administrator
Administrator

3. Replace "TableName" with the name of the table containing the column you want to count and "ColumnName" with the name of the column containing "yes" and "no".

4. Click "OK" to create the measurement.

Syndicate_Admin
Administrator
Administrator

Here's how:

1. Create a new measure in the "View" tab of Power BI Desktop by clicking "New Measure" on the ribbon.

2. Type the following formula in the formula bar:

Conteo Si = COUNTROWS(FILTER('NombreTabla', 'NombreTabla'[NombreColumna] = "si"))
Syndicate_Admin
Administrator
Administrator

Hello @Keviincr22,

In Power BI, you can count "yes" text in a column containing "yes" and "no" using the CONTARROWS function and the FILTER function.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.