Forum Discussion
weilai0521
7 years agoFrequent 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!
As a calculated column, you can use
Column = VAR myrow={[A],[B],[C],[D]} RETURN COUNTROWS(Filter(myrow,[Value]="Yes"))
2 Replies
- Zubair_MuhammadCommunity Champion
As a custom column using Power Query / M
=List.Count( List.Select( Record.ToList(_),each _ ="Yes")) - Zubair_MuhammadCommunity Champion
As a calculated column, you can use
Column = VAR myrow={[A],[B],[C],[D]} RETURN COUNTROWS(Filter(myrow,[Value]="Yes"))