cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
TRIPPR Frequent Visitor
Frequent Visitor

LOOKUPVALUE with IF statements

Hi All, 

 

I have two tables;

TABLE 1 contains a list of items, 

 

In TABLE 2, I want to result a "YES" IF,

Column 'SUB' = "ABC", 

and IF

Column 'ITEM' matches data in TABLE 1, Column 'ITEM'

 

If the 'SUB' column in TABLE 1 does not match "ABC", I want the cell to remain blank. 

 

Thanks in advance for your help.

T

 

TABLE 1
ITEM
a
b
d
e

 

TABLE 2
subitemmatch
abcayes
abcbyes
abccno
abcdyes
abceyes
efga 
efgb 
efgc 
efgd 
efge 
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: LOOKUPVALUE with IF statements

@TRIPPR 

 

Try this column

 

Column =
SWITCH (
    TRUE (),
    [sub] <> "abc", BLANK (),
    [sub] = "abc"
        && COUNTROWS ( INTERSECT ( { [item] }, VALUES ( Table1[ITEM] ) ) ) > 0, "yes",
    "No"
)
1 REPLY 1
Super User
Super User

Re: LOOKUPVALUE with IF statements

@TRIPPR 

 

Try this column

 

Column =
SWITCH (
    TRUE (),
    [sub] <> "abc", BLANK (),
    [sub] = "abc"
        && COUNTROWS ( INTERSECT ( { [item] }, VALUES ( Table1[ITEM] ) ) ) > 0, "yes",
    "No"
)

Helpful resources

Announcements
Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 296 members 3,124 guests
Please welcome our newest community members: