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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
PedroPascual
Helper I
Helper I

QA comparicion between Values

Hi Community,

hopefuly, you can help me with this formula.

i need to do a QA based on values from different columns and tables.

 

table1
column1column2column3 QA
value1value2value3  
housecardog YES
housecardog YES
housecarcat NO

 

I already have the formula for the same table:

Comparision2Value =
IF (
    AND (
        OR (
            Table1[Column2] = "Car",
            Table1[Column3] = "Dog"
        ),
        Table1[Column1] = "House"
    ),
    "Yes",
    "No"
)

 

This formula works perfectly. The main strategy is if the value from column 1 has the values in the same raw in two different columns then yes.

 

My problem now is to do the same but with more values from different tables.

table1table 2table 3  
column1column2column3Column1Column1 QA
value1value2value3value4value5  
housecardogpencilapple YES
housecardogpencillemon NO
housecarcatbookorange 

NO

 

The main strategy is if the value from Table 1 column1 has in the rest of the columns the specific values then yes, otherwise no

 

Can anyone help me??

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PedroPascual ,

 

We can create a calculated column.

QA =
IF (
    AND (
        AND (
            'Table'[Column1] = "House",
            'Table'[Column2] = "cat"
                || 'Table'[Column2] = "dog"
                || 'Table'[Column2] = "rabbit"
                || 'Table'[Column2] = "lion"
        ),
        'Table'[Column3] = "book"
            || 'Table'[Column3] = "pencil"
    ),
    "YES",
    "NO"
)

vtangjiemsft_0-1691481248313.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @PedroPascual ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) Click "transform data" to enter the power query, add an index column for each table, and merge into one table.

vtangjiemsft_0-1691474285921.png

(3)We can create a calculated column.

QA = IF('Table1'[column1]="value1",BLANK(), IF('Table1'[Table2.column2]="car" && 'Table1'[Table3.column3]="dog" && 'Table1'[Table4.column4]="pencil" && 'Table1'[Table5.Column5]="apple","YES","NO"))

(4) Then the result is as follows.

vtangjiemsft_1-1691474338863.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

@Anonymous, thanks very much for your reply. your response is correct.
however, I did wrong my proposal.
Let me re-formulate the issue I have, a little bit more clear.
the conditional value shall be based in at least 3 conditional values:
the value "house" from Column1 must contain in column2 "cat" and/or "dog" and/or "rabbit" and/or "lion" and in column3 "book" and/or "pencil" otherwise is NO;

Column1Column2Column3QA
HousecatbookYES
HousedogbookYES
Housecat pencilYES
HousedogpencilYES
HouserabbitwindowNO
HouseliondoorNO


and it could be a possibility that a fourth column with another rule will be used.

it is clear??

thanks in advance

Anonymous
Not applicable

Hi @PedroPascual ,

 

We can create a calculated column.

QA =
IF (
    AND (
        AND (
            'Table'[Column1] = "House",
            'Table'[Column2] = "cat"
                || 'Table'[Column2] = "dog"
                || 'Table'[Column2] = "rabbit"
                || 'Table'[Column2] = "lion"
        ),
        'Table'[Column3] = "book"
            || 'Table'[Column3] = "pencil"
    ),
    "YES",
    "NO"
)

vtangjiemsft_0-1691481248313.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

@Anonymous Wonderful. it is working properly. thanks.

last question, what about if I have information in different tables??
does not work.

QA =
IF (
AND (
AND (
'Table1'[Column1] = "House",
'Table2'[Column2] = "cat"
|| 'Table2'[Column2] = "dog"
|| 'Table2'[Column2] = "rabbit"
|| 'Table2'[Column2] = "lion"
),
'Table1'[Column3] = "book"
|| 'Table1'[Column3] = "pencil"
),
"YES",
"NO"
)

Anonymous
Not applicable

Hi @PedroPascual ,

 

If he is in different tables, refer to Message 4, click on "Transform Data" to access the Power Query, add index columns for each table, and merge them into one table.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Ahmedx
Super User
Super User

it's not clear what you want.
can you explain why there is no in next line:
house machine dog pencil lemon NO

The rule I need to create in the formula is:

if the value1 in Table1 and Column1 contains the other values "car", "dog", "pencil" & "apple"  is a "Yes", otherwise is a "NO".

Other Values can be in the same table or in different tables, but with a relation with Value1

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