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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
willit6182
Frequent Visitor

Summing related tables

New BI user here and I'm having trouble getting a relationship sum function to work.

 

I have a many-to-many relationship between ENCOUNTERID and PROCEDURE CODE. I am currently using a bridge table to create the many to many relationship. ENCOUNTERID is unique and distinct in the Encounters table. PROCEDURE CODE is unique and distinct in the CPT table.

 

For each ENCOUNTERID, there are many PROCEDURE CODEs and each PROCEDURE CODE has a single specific (but not unique) RVU number value assigned to it.

 

I am interested in the total RVU number value for a group of ENCOUNTERIDs.

 

I have tried creating a measure using the SUM() and SUMX() with filters but cannot seem to get it to rollup into a total for for each encounter and then add those up. I have also tried manipulating the relationship directions to no avail.

 

Can anyone provide any guidance?

 

Thanks!!

 

2024-06-27_134511.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @willit6182

 

Create a Measure for RVU Total.

 

Total RVU = 
SUMX(
    RELATEDTABLE('BridgeTable'),
    CALCULATE(SUM('CPT'[RVU]))
)

 

 

This measure iterates over each row in the 'BridgeTable' that is related to your current context and then calculates the sum of the RVU values from the 'CPT' table.  

 

If you're still having problems, provide some dummy data and the desired outcome. It is best presented in the form of a table.

 

Regards,

Nono Chen

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

1 REPLY 1
Anonymous
Not applicable

Hi @willit6182

 

Create a Measure for RVU Total.

 

Total RVU = 
SUMX(
    RELATEDTABLE('BridgeTable'),
    CALCULATE(SUM('CPT'[RVU]))
)

 

 

This measure iterates over each row in the 'BridgeTable' that is related to your current context and then calculates the sum of the RVU values from the 'CPT' table.  

 

If you're still having problems, provide some dummy data and the desired outcome. It is best presented in the form of a table.

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.