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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.