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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jvanmeter
Frequent Visitor

Lookup Multiple Rows Return Yes or No

I have two tables (Users) and (Groups).

 

Users looks something like:

 

DistinguishedName     Type     Status        Etc.

Test1                            User     Enabled     Other Info

Test2                            User     Enabled     Information

Test3                            User     Enabled     More Info 

 

Groups looks something like:

 

DistinguishedName     Group    

Test1                            Group1

Test1                            Group2

Test1                            Group3

Test2                            Group2

Test2                            Group3

Test3                            Group3

 

 

I want to add a column on the Users Table that essentially is Titled "Group 1 is Member" and the row for that column will be yes or No.

 

The two tables have a relationship on DinstinguishedName

 

I want to lookup from Users to Groups on Dinstinguishedname and tell me if they are a member of the specific group. 

 

I was trying  Group1ISMember = LOOKUP('Groups'[Group],'Groups'[DistinguishedName],'Users'[DinstinguishedName])

But i get the error of multiple values returned. 


How do I do a lookup from Table Users to Table Groups and Tell me if they are a member of Each Specific Group and return a Yes or No? 

 

Thank you for your help. 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi @jvanmeter

 

Please try this Column in Users Table

 

Group 1 is Member =
IF (
    CALCULATE ( COUNT ( Groups[Group] ), Groups[Group] = "Group1" )
        >= 1,
    "Yes",
    "No"
)

Regards
Zubair

Please try my custom visuals

View solution in original post

1 REPLY 1
Zubair_Muhammad
Community Champion
Community Champion

Hi @jvanmeter

 

Please try this Column in Users Table

 

Group 1 is Member =
IF (
    CALCULATE ( COUNT ( Groups[Group] ), Groups[Group] = "Group1" )
        >= 1,
    "Yes",
    "No"
)

Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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