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
kault
Helper II
Helper II

RELATED() or LOOKUP()

I have two tables. One table is called "Customer", one table is called "Invoice". The relationship is set on the field "primary email address", where the cardinality is Many:Many.

 

I have a column on the Cusomter Table called Account Name. I need a column on the Invoice table that populates the Account Name. I  just want to bring the account name from the Customer table to the Invoice table. 

 

I've tried doing this with RELATED() and the field is not an option. I don't know how to do it with LOOKUP.

 

 

1 ACCEPTED SOLUTION
mahoneypat
Employee
Employee

Since you have M:M relationship, you can use an expression like this to return the Account Name

 

AccountName = MAXX(RELATEDTABLE(Customers), Customers[AccountName])
 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

1 REPLY 1
mahoneypat
Employee
Employee

Since you have M:M relationship, you can use an expression like this to return the Account Name

 

AccountName = MAXX(RELATEDTABLE(Customers), Customers[AccountName])
 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.