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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
vnqt
Helper V
Helper V

Vlookup in 2 columns (OR)

Hi,

 

I would like to use vlookup to compare ColumnA of TableA to 2  columns (B1 and B2) in TableB:

 

if(ISBLANK(LOOKUPVALUE(TableA[ColumnA],TableA[ColumnA],TableB[ColumnB1])),"No","Yes")
 
if(ISBLANK(LOOKUPVALUE(TableA[ColumnA],TableA[ColumnA],TableB[ColumnB2])),"No","Yes")
 
I would like to group the 2 DAX, it means IF TableA[ColumnA] exists in TableB[ColumnB1] OR TableB[ColumnB2] , YES, NO
 
Thank you in advance for your help
Tg
1 ACCEPTED SOLUTION
Barthel
Solution Sage
Solution Sage

Hey @vnqt,

Give this a try:

 

Column = 
IF (
    OR (
        CALCULATE (
            NOT ISEMPTY ( 'TableB' ),
            TREATAS ( { TableA[ColomnA] }, 'TableB'[ColumnB1] )
        ),
        CALCULATE (
            NOT ISEMPTY ( 'TableB' ),
            TREATAS ( { TableA[ColomnA] }, 'TableB'[ColumnB2] )
        )
    ),
    "YES",
    "NO"
)

 

View solution in original post

3 REPLIES 3
Nathaniel_C
Super User
Super User

Hi @vnqt ,
Please give us a visual example of the tables and expected outcome.


If you would share your pbix, or dummy up some values in Excel both for current and expected data. Please copy and paste them into your post, rather than doing a picture, we may be able to help you. 

Please read this post to get your question answered more quickly:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Barthel
Solution Sage
Solution Sage

Hey @vnqt,

Give this a try:

 

Column = 
IF (
    OR (
        CALCULATE (
            NOT ISEMPTY ( 'TableB' ),
            TREATAS ( { TableA[ColomnA] }, 'TableB'[ColumnB1] )
        ),
        CALCULATE (
            NOT ISEMPTY ( 'TableB' ),
            TREATAS ( { TableA[ColomnA] }, 'TableB'[ColumnB2] )
        )
    ),
    "YES",
    "NO"
)

 

Thank you for your help

 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors