Forum

count the number of...
 
Notifications
Clear all

count the number of true/false in fields for each row in power query

3 Posts
2 Users
0 Reactions
390 Views
(@wannabe)
Posts: 2
New Member
Topic starter
 

Hi, I am wanting to count how many of the columns for each row have a "true" value. Up to now I have created a custom column for each column that had true/false by giving true a value of one and false 0 and then deleted the original column. Finally i summed the total.

This time I have a lot of columns and so don't want to go through that long process but count the number of true.

Is there a formula that I can use that recognises true and can count them?

thanks so much, Mike

 
Posted : 05/10/2019 11:28 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Mike,

Duplicate the query, then unpivot the columns containing TRUE/FALSE.

Filter the duplicated query for only TRUE rows and remove the column containing the original column headers.

Then Group By > Count.

Lastly, merge the queries together bringing in the count column.

See example file attached.

Mynda

 
Posted : 06/10/2019 8:19 pm
(@wannabe)
Posts: 2
New Member
Topic starter
 

Thank you Mynda that is exactly what I wanted to achieve and so simple too. Laugh

 
Posted : 06/10/2019 11:11 pm
Share: