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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

IF statement between tables with a many to many relationship

Hello

 

I have two tables that have a many to many relationship as I have no distinct value in either table. I am trying to add an extra column to table A using a IF statement to reference table B.

 

The formula doesn't work unfortunately. I get the error message "UUID cannot be found" I'm trying to use

 

IF('TableA'[UUID]=Related(TableB[UUID])&&'TableA'[PRODUCT]=RELATED('TableB'[PRODUCT]),"YES","NO")

 

Maybe someone out there can help?

 

Thanks

Joe

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks guys

 

I have managed to do by using the Lookup function. Thanks for replying.

 

= IF (
COUNTROWS (
FILTER ( TableB, 'TableA'[UUID]= TableB[UUID] && 'TableA'[PRODUCT] = TableB[PRODUCT] )
)
> 0,
"YES",
"NO"
)

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thanks guys

 

I have managed to do by using the Lookup function. Thanks for replying.

 

= IF (
COUNTROWS (
FILTER ( TableB, 'TableA'[UUID]= TableB[UUID] && 'TableA'[PRODUCT] = TableB[PRODUCT] )
)
> 0,
"YES",
"NO"
)
affan
Solution Sage
Solution Sage

Hi @Anonymous,

 

How about creating a calculated table first to have unique values. If you can share some sample of your data and what reuslt you expect, it will help getting to the solution fast.

 

 

Regards,

Affan

LivioLanzo
Solution Sage
Solution Sage

Hi @Anonymous

 

You cannot use RELATED in presence of a Many-To-Many Relationship.

It can only be used in the presence of a One-To-Many Relationship within the table which is on the Many side of the relationship.

 


 


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


Proud to be a Datanaut!  

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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