Forum Discussion
Tackle Many to many relationship ?
- Anonymous1 year ago
Hi Anonymous ,
The RELATED function only works in many-to-one or one-to-one relationships because it is designed to return a single value. In a many-to-many relationship, there may be multiple related values and it is impossible to determine which value to return.
Since you created the relationship, you can calculate it directly without creating a calculated column by creating a measure, you can write it as:
DIVIDE ( SUM ( 'BridgeTable'[the calculated column'] ) * SUM ( 'tab_weight'[weight] ), IF ( MAX ( 'tab_indicators'[value] ) = BLANK (), 0, SUM ( 'tab_weight'[weight] ) ) )If the problem persists, can you provide .pbix file with sensitive data removed or a portion of each table to help the problem be resolved more quickly?
Best Regards,
Zhu
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
The RELATED function only works in many-to-one or one-to-one relationships because it is designed to return a single value. In a many-to-many relationship, there may be multiple related values and it is impossible to determine which value to return.
Since you created the relationship, you can calculate it directly without creating a calculated column by creating a measure, you can write it as:
DIVIDE (
SUM ( 'BridgeTable'[the calculated column'] ) * SUM ( 'tab_weight'[weight] ),
IF (
MAX ( 'tab_indicators'[value] ) = BLANK (),
0,
SUM ( 'tab_weight'[weight] )
)
)
If the problem persists, can you provide .pbix file with sensitive data removed or a portion of each table to help the problem be resolved more quickly?
Best Regards,
Zhu
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.