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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

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
Community Champion
Community Champion

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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