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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
DavidGolden
Helper I
Helper I

problem on calculation with with many-to-many related colum

Hello Community, 

 

I have a dataset with totals sums for different operations, operations refers to differente "Groups".

 

DavidGolden_1-1660582719022.png

 

Groups are RELATED to other table Apport, wich details how each Group is apportioned between individuals (cities). The sum of % for all individuals in each Group adds up to 100%; they are detailed as in the pic below. Relationship is of many-to-many, since each Group appears many times in both tables. 

DavidGolden_0-1660582499370.png

I need to get Totals for each Individual city, My aproach was to build a meassure in PowerBI typing sumx(Total*related(%)). Despite the relationship seems to be correctly specified (working both ways), It doesn´t work, and I´m getting the message "The column 'Apport[%]' either doesn't exist or doesn't have a relationship to any table available in the current context."

I gues my approach may not be the propper one. Could you help me find a solution, please?

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @DavidGolden 
Please try

NewMeasure =
SUMX (
    Apport,
    VAR CurrentPercent = Apposrt[%]
    VAR TotalGroup =
        SUMX ( RELATEDTABLE ( Group ), Group[Total] )
    RETURN
        TotalGroup * CurrentPercent
)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @DavidGolden 
Please try

NewMeasure =
SUMX (
    Apport,
    VAR CurrentPercent = Apposrt[%]
    VAR TotalGroup =
        SUMX ( RELATEDTABLE ( Group ), Group[Total] )
    RETURN
        TotalGroup * CurrentPercent
)
DavidGolden
Helper I
Helper I

It´s worth noting that each Individual city appears more than once in the Apport table.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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