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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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