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
HarryClark
New Member

If any of 6 given columns return a "No" value, give a No in Custom Column

Hi all, 

 

Hope everyone is well and looking forward to the weekend. 

 

I have an issue, where I have a table/query in PowerBI that contain 67 columns. 6 of those columns return a Yes or No based on whether a criteria in an assessment is met. I need to create a custom column, lets say "Is the place functional?", that returns a "No" value if any of those 6 columns in that row contain a "No" as an answer to their criteria. 

 

Now, in excel I would format the formula as:

 

=IF(COUNTIF(R16:W16,"No"),"No","Yes")

 

I am not greatly familiar with PowerQuery or DAX expressions so I was just wondering how I could manage this, I am at a complete loss and would really appreciate any help!! 

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Another alternative approach for a custom column

You will need to replace [Column4], [Column6], [Column7] with you six column names.

= if List.Contains(Record.ToList([[Column4], [Column6], [Column7]]), "No") then "No" else "Yes"

View solution in original post

4 REPLIES 4
Vijay_A_Verma
Super User
Super User

Another alternative approach for a custom column

You will need to replace [Column4], [Column6], [Column7] with you six column names.

= if List.Contains(Record.ToList([[Column4], [Column6], [Column7]]), "No") then "No" else "Yes"

This worked perfectly, thank you so much!

AlienSx
Super User
Super User

Hi, @HarryClark 

let
    // list of "given column" names
    given_columns = {"one", "two", "three", "four", "five", "six"},
    // replace your_table with a ref to your actual table
    result = 
        Table.AddColumn(
            your_table, "Is the place functional?", 
            (x) => 
                if List.Contains(
                    Record.FieldValues(Record.SelectFields(x, given_columns)),
                    "No"
                ) then "No" else "Yes"
        )
in
    result

Thank you! This looks interesting though more complex than the other solution, I am going to give it a try and see as well though. 

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.

Top Solution Authors