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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Multiply two tables with a many to many relationship

I want to multiply Split by the Volume on the match of Hopital and Pathway. The added issue I have aswell is the both tables are a many to many relationship on Hospital and Pathway, which I can resolve by creating reference tables and joining both tables to them.

I get results with 

Volume Split by Overnight = SUM(Activity[Volume])*SUM(Hospital[Split])

But I get the incorrect total.

 

Here is the tables;

Table and Results

 

 

Relationships to resolve many to many;

 

Relationship

 

Thank you in advance!

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

Based on your steps, please create the measure below to achieve your desired output.

 

Measure =
VAR _table =
    FILTER (
        GENERATE ( Activity, Hostipal ),
        Activity[Hospital] = Hostipal[Hospital]
            && Activity[Pathway] = Hostipal[Pathway]
    )
RETURN
    SUMX ( _table, [Volume Split by Overnight] )

Here is the output.

 

Capture.PNG

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

Based on your steps, please create the measure below to achieve your desired output.

 

Measure =
VAR _table =
    FILTER (
        GENERATE ( Activity, Hostipal ),
        Activity[Hospital] = Hostipal[Hospital]
            && Activity[Pathway] = Hostipal[Pathway]
    )
RETURN
    SUMX ( _table, [Volume Split by Overnight] )

Here is the output.

 

Capture.PNG

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Dear Cherry

 

I have a very similar problem like JayZee64.

Many-to-Many-Relationship

 

Applying your solution I noted that it took a bit of time to calculate the measure with a mid-sized table.

Does the below method also work well with large tables?

Are there alternative options you would recommend besides the _table on the fly?

 

Many thanks in advance

F.

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.