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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.