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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
brs09j
Helper II
Helper II

Getting an amount when the two tables don't have a relationship

So I have tables A, B and C

 

Table A is the fact table and table B is related to table A in a One-to-many relationship.

 

Table B is related to table C in a One-to-many relationship as well.

 

Table A and Table C have no direct relationship. However, they are both related to table B.

 

I want the amount from the cost column in table A to go under the product description column from table C in a matrix.

 

I wrote the following below but I'm not sure it is correct or even needed. Do I just need to switch my relationship filtering settings? Joining table A to table C would be many to many. Is that even allowed in Power BI?

 

Sales Amount =
CALCULATE (
    SUMX ( Table_A, Table_A[Cost] * Table_A[Quantity] ), 
    Table_C
)

 

 

Thanks.

 

1 ACCEPTED SOLUTION

It's going to be dependent on the cross-filter directions of your relationships. If Table A filters your bridge table, Table B and Table B filters Table C then you have a many-to-many relationship in your case or vice versa. I'd have to see the relationship map.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

In theory, you should not need that calculation since it is a simple SUM essentially. You can have many-to-many in Power BI with a bridge table as you have in your model. I'd have to model out what you are doing to be certain, can you supply sample data?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler

 

I'm sorry, I don't have any generic sample data. You say that it is a normal SUM since the amount is already stored on Table A and no calculation is needed. That part makes sense to me, but since there is no relationship I can't use RELATED or RELATEDTABLE.

@Greg_Deckler

 

To check,

 

I created a calculated column on table B

 

Transaction Amount = 
   SUMX (
        RELATEDTABLE ( Table_A) , Table_A[Expenses] * 1)

 

I get unique values here for my new column but when I drag the new field into the matrix I get the same number repeating

@Greg_Deckler

 

I made the expenses a row in the matrix visualization instead of a value and that gave me the unique numbers I needed. Any idea why it works that way?

 

Thanks.

It's going to be dependent on the cross-filter directions of your relationships. If Table A filters your bridge table, Table B and Table B filters Table C then you have a many-to-many relationship in your case or vice versa. I'd have to see the relationship map.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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