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

Create a flag from lookup of data in another table

I have two tables - Table A has a User ID column.  Table B has two Columns - User ID and Subscriptions.  This is a one to many relationship, joined by User ID.  What I am trying to do is add a column to Table A that would return Yes/No if a certain Subscription is found in Table B.  The value in Subscription I want to search for is "Ambassador".

 

I'm new to PowerBI so apologizes and the searches I have been doing don't quite fit the simple scenario I am trying to do with DAX.

 

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

The ideal solution would be not to have to do that at all, but to let the data model do the work for you.

Second best is to use TREATAS to project filters from one table to another even if they are not directly connected

And lastly, shamefully, there is LOOKUPVALUE.

View solution in original post

Anonymous
Not applicable

Hi @ryangleason ,

As @lbendlin suggested, you can get the value of the field from another table by using LOOKUPVALUE function.

You can also create a calculated column in table A as below to get it:

Column =
VAR _userid = 'A'[User ID]
VAR _subscription =
    CALCULATE (
        MAX ( 'B'[Subscriptions] ),
        FILTER ( 'B', 'B'[User Id] = _userid && 'B'[Subscriptions] = "Ambassador" )
    )
RETURN
    IF ( NOT ( ISBLANK ( _subscription ) ), "Yes", "No" )

vyiruanmsft_0-1710321537075.png

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @ryangleason ,

As @lbendlin suggested, you can get the value of the field from another table by using LOOKUPVALUE function.

You can also create a calculated column in table A as below to get it:

Column =
VAR _userid = 'A'[User ID]
VAR _subscription =
    CALCULATE (
        MAX ( 'B'[Subscriptions] ),
        FILTER ( 'B', 'B'[User Id] = _userid && 'B'[Subscriptions] = "Ambassador" )
    )
RETURN
    IF ( NOT ( ISBLANK ( _subscription ) ), "Yes", "No" )

vyiruanmsft_0-1710321537075.png

Best Regards

lbendlin
Super User
Super User

The ideal solution would be not to have to do that at all, but to let the data model do the work for you.

Second best is to use TREATAS to project filters from one table to another even if they are not directly connected

And lastly, shamefully, there is LOOKUPVALUE.

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