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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a couple tables. FactTable1 is connected to all dimensions and FactTable2 has some preagregated data and has only one realtion to FactTable1 (many) <-FactTable2(one) using CompositeId.
Tables structure:
| FactTable1 |
| PrimaryId |
| CompositeId |
| .... |
| Amount |
and
| FactTable2 |
| CompositeId |
| DifferentAmount |
I would like to use FactTable1 distinct CompositeId values and get a sum of FactTable2[DifferentAmount].
My current code that doesn't work:
//Code works, but return bigger result that expected
//probably, because the calculation has duplications and adds the same value
//from FactTable2[DifferentAmount] several times
SUMX (
FactTable1,
RELATED (FactTable2[DifferentAmount])
)
//This code should remove duplicates, but it doesn't work
SUMX (
DISTINCT (FactTable1[CompositeId]),
RELATED (FactTable2[DifferentAmount])
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 32 | |
| 31 | |
| 18 | |
| 12 | |
| 11 |