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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

With using Many-to-Many relationship, when I use measure or sum the amount, some value don't show

Hi all, 

I have two tables:

T1:

TYPEKEYNAMEAMOUNT
TYPE1AAAA12
TYPE2AAAA12
TYPE1BBBB13
TYPE2CCCC14
TYPE1DDDD11

 

T2:

KEYCUSTOMER
AAAA2
AAAA3
BBBB2
CCCC2

 

And the column KEY is the relationship key between these two tables; it's a many-to-many relationship.

 

And when I create a table in my power bi:

With using Many-to-Many relationship, when I use measure or sum the amount, some value don't show1.PNG

 

Question 1: You can see the AMOUNT of D1 is missing. Why?

Question 2: After I change the column sort like the below image, the AMOUNT is also missing, but after I change the format of AMOUNT to "Don't Summarize", then the AMOUNT show up. Why?

 

With using Many-to-Many relationship, when I use measure or sum the amount, some value don't show2.PNG

 

Thanks in advance.

Aiolos Zhao

 
1 ACCEPTED SOLUTION

I have given you some advice about data modeling - that advice is correct.  I have taken a closer look at your sample data.  What you need to understand about Power BI is that the rows in the tables will filter the other tables in the model (in the direction of the filter arrows only).

 

Back to your questions.

1. The reason the value D1 is missing is due to filtering.  When you place Name and Customer onto the rows in the table, you are putting filters on both of those columns.  In otherwords, you are saying "Show all the data where Name = D1 and Customer = Blank.  There is no such data in your model, and that is why it is not showing.  If you remove the Customer from the visual, then you will see the value.

 

2. When you say "don't summarise", you are changing the behaviour of the model.  You are now filtering on all 3 columns.  Power BI shows the list of values for all 3 columns.

 

The test data you have shared is not very descriptive, so it is not clear what it is or how it should be used.  Power BI is a semantic data modelling tool.  It is designed to accept entitiy based dimension tables and also fact tables (dimensional modelling).    I can't advise you on how to set up your data because there is no context in the table names.



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

11 REPLIES 11
Anonymous
Not applicable

Or any documentation about this so I can know more information?

 

Thanks.

Aiolos Zhao

Your new table should also have the Name included.  You should always use columns from this new table in your visual (the text ones).  You can then use the numeric columns from any table.

 

It is not clear in your image which table the Key column has come from.  My guess is it is not the new table. 


You can read my artile her for more information. https://exceleratorbi.com.au/the-optimal-shape-for-power-pivot-data/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

And I have read the documentation you shared with me, thanks.

 

But I think that's talk about the star schema, and I know the cons and pros for star schema, snow schema, etc.

 

I didn't find an explanation of my two questions.

 

Aiolos Zhao

Anonymous
Not applicable

Hi @MattAllington ,

 

Thanks for your reply, as you can see, I have two tables like below:

T1:

TYPEKEYNAMEAMOUNT
TYPE1AAAA12
TYPE2AAAA12
TYPE1BBBB13
TYPE2CCCC14
TYPE1DDDD11

 

T2:

KEYCUSTOMER
AAAA2
AAAA3
BBBB2
CCCC2

 

For Power BI, what's the best way to make below table:

NAMEAMOUNTCUSTOMER
A12A2
A12A3
B13B2
C14C2
D11 

 

Could you please show and tell me?

Thanks in advance

Aiolos Zhao

In the visual you posted above, after you created the third table, which key are you using in the visual?  It should be the key column from the new table.  Is it?



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

Do you mean the T3?

The KEY column in T3 is created by manually, just merge all values of KEY from T1 and T2.

 

You can also forget the T3 I created, just using T1 and T2, I have shown you the table that I want.

 

What kind of operations should I do now?

 

Aiolos Zhao

I am trying to help you here.  You need the other table (you called it T3).  Create the table as I described and add the other columns that are part of the key too (customer, name etc).


Join the 3 tables as I described

Then use the Key column from T3 and not from the other tables.  

 

This is how you do it.  If you can't work it out, then post a link to your sample workbook here and I will do it for you.



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

Could you please show me what the T3 should look like using below T1/T2?

T1:

TYPEKEYNAMEAMOUNT
TYPE1AAAA12
TYPE2AAAA12
TYPE1BBBB13
TYPE2CCCC14
TYPE1DDDD11

 

T2:

KEYCUSTOMER
AAAA2
AAAA3
BBBB2
CCCC2

I have given you some advice about data modeling - that advice is correct.  I have taken a closer look at your sample data.  What you need to understand about Power BI is that the rows in the tables will filter the other tables in the model (in the direction of the filter arrows only).

 

Back to your questions.

1. The reason the value D1 is missing is due to filtering.  When you place Name and Customer onto the rows in the table, you are putting filters on both of those columns.  In otherwords, you are saying "Show all the data where Name = D1 and Customer = Blank.  There is no such data in your model, and that is why it is not showing.  If you remove the Customer from the visual, then you will see the value.

 

2. When you say "don't summarise", you are changing the behaviour of the model.  You are now filtering on all 3 columns.  Power BI shows the list of values for all 3 columns.

 

The test data you have shared is not very descriptive, so it is not clear what it is or how it should be used.  Power BI is a semantic data modelling tool.  It is designed to accept entitiy based dimension tables and also fact tables (dimensional modelling).    I can't advise you on how to set up your data because there is no context in the table names.



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
MattAllington
Community Champion
Community Champion

This is a complex topic. The simple answer is “don’t use many to many unless you know when it works and when it doesn’t”. I suggest you create a new table with a distinct list of all the keys. Join both tables to this new table (1 to many) and use the new table in your visuals.  This is how power BI is designed to work. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

Hi @MattAllington ,

 

Thanks for the reply.

Do you mean I need to create a new table like below:

T3:

KEY
AAA
BBB
CCC
DDD

 

Then I create relationships like below:

With using Many-to-Many relationship, when I use measure or sum the amount, some value don't show3.PNG

 

But the AMOUNT is also missing in my table:

With using Many-to-Many relationship, when I use measure or sum the amount, some value don't show4.PNG

 

Or do you mean I need to use "merge query" in edit query?

 

I think if my data is too large, the merge query would cost too much time.

 

Aiolos Zhao

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors