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
weilai0521
Frequent Visitor

Count columns with 'Yes'

Hi, 

 

I have multiple columns with 'Yes', 'No' or missing (null or '.'). I want to create a Count column that count the number of 'Yes' for each row. 

 

For example, if I have the following data, the count would be 2. 

 

A      B     C     D

Yes  Yes  No   . 

 

Thanks!

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@weilai0521 

 

As a calculated column, you can use

 

Column = VAR myrow={[A],[B],[C],[D]}
RETURN
COUNTROWS(Filter(myrow,[Value]="Yes"))

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@weilai0521 

 

As a custom column using Power Query / M

 

=List.Count(
    List.Select(
    Record.ToList(_),each _ ="Yes"))
Zubair_Muhammad
Community Champion
Community Champion

@weilai0521 

 

As a calculated column, you can use

 

Column = VAR myrow={[A],[B],[C],[D]}
RETURN
COUNTROWS(Filter(myrow,[Value]="Yes"))

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.