Forum Discussion
Sum Removing Duplicates
- 1 year ago
Hello Soc3,
We hope you're doing well. Could you please confirm whether your issue has been resolved or if you're still facing challenges? Your update will be valuable to the community and may assist others with similar concerns.
Thank you.
Hi Soc3
You can achieve this in Power BI by creating a measure that only sums values that don’t cancel each other out (for example, when the sum per Unique ID is not zero). Here’s a direct DAX approach. Create a measure to sum only non-cancelled amounts per Unique ID:
Net Total Amount =
VAR NetSum = SUMX(
VALUES('YourTable'[Unique ID]),
CALCULATE(SUM('YourTable'[Total Amount (USD)]))
)
RETURN
IF(NetSum <> 0, NetSum, 0)
To display in your table. Use Unique ID and this new Net Total Amount measure. If you want a calculated column for row-level logic, you can mark rows as zero when they are pairs that sum to zero using grouping and logic in Power Query, but for visuals, a measure like above is best.