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
newpbiuser01
Helper IV
Helper IV

Lookup and Sum of Values from Another Table

Hello,

 

I'm trying to lookup values from Table 1 - match to similar values in Table 2 and if a match is found, get a sum of the total amount, and if no match found, return a 0 or a blank. Since we have multiple instances of the names in each column, I created a many-many relationship with the Table 1 set to filter Table 2. However, when I try to add the sum of the Amount column to the Table 1, it looks like Table 1 gets filtered too:

 

Table 1:

Name
Andy
Bob
Joe
Mike
Susan

 

Table 2:

NameAmount
Andy10
Andy100
Bob1000
Joe500
Peter10
Peter5
Sally50

 

Expected Result in Table 1:

NameAmount
Andy110
Bob1000
Joe500
Mike0
Susan0

 

However, what I do get for Table 1 is:

NameAmount
Andy110
Bob1000
Joe500

 

newpbiuser01_0-1657829053936.png

 

How do I do the lookup and sum without my primary table getting filtered out? I'd really appreciate any help. 

 

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @newpbiuser01 

Many-to-many relationship is not recommended here.

Please modify it as follows.

veasonfmsft_0-1658306757331.png

veasonfmsft_1-1658306800592.png

Best Regards,
Community Support Team _ Eason

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @newpbiuser01 

Many-to-many relationship is not recommended here.

Please modify it as follows.

veasonfmsft_0-1658306757331.png

veasonfmsft_1-1658306800592.png

Best Regards,
Community Support Team _ Eason

amitchandak
Super User
Super User

@newpbiuser01 , Make it bi directional and try. Having a many to many it not a good idea

 

Create a common table and try

https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solutio...

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.