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
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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.