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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
polmar
New Member

Sum accross 3 related tables

I don't know how to explain this. I have three tables as in the picture.

 

ModelPBI.png

 

I need to sum the Agr.Saldo field in the "ApuntesAgrupados" table, at two levels: per Account and per Epigraph (Charter), but in the epigraphs you can repeat "n" times the same account. So, when I apply that the formula 

Saldo = SUMX(RELATEDTABLE(ApuntesAgrupados); ApuntesAgrupados[Agr.Saldo])

the amount per account is correct (ratio many to 1) but the total per Epigraph returns me the grand total, and not the sum of the accounts that make it up.

 

ExampleTable.png

 

I don't know if I can make myself clear.... If yes, any ideas please?

 

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@polmar

 

In this scenario, you have "1 to many" relationship with single direction from Account to ApuntesAgrupados. So dim account can slice ApuntesAgrupados.

 

However, you also have "1 to many" relationship with single direction from Account to Chapter. When you analyze on Chapter level, it will always take the aggregation of account for each chapter. So in your scenario, you should change this direction into "both", and put chapter under account level. 

 

Regards,

View solution in original post

1 REPLY 1
v-sihou-msft
Microsoft Employee
Microsoft Employee

@polmar

 

In this scenario, you have "1 to many" relationship with single direction from Account to ApuntesAgrupados. So dim account can slice ApuntesAgrupados.

 

However, you also have "1 to many" relationship with single direction from Account to Chapter. When you analyze on Chapter level, it will always take the aggregation of account for each chapter. So in your scenario, you should change this direction into "both", and put chapter under account level. 

 

Regards,

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.