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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi
I have a table where I am trying to sum up margin at a unique level.
The table has unique sales ids but can have multiple products so has duplicate lines.The problem here is that the margin is locked at a sale id level so is duplicated, I need the margin for each product but I end up getting duplicate values included in my sum!
I have used
Made Up ID | Margin | Price | Product |
1245 | 4510 | 300 | A |
1245 | 4510 | 200 | B |
1245 | 4510 | 100 | C |
Result now | Desired Result | ||
Product | Margin | Product | Margin |
A | 13530 | A | 4510 |
Solved! Go to Solution.
@Jitmondo , Try measure like
Distinct Margin = SUMX(values(Opportunity[Id]), FIRSTNONBLANKVALUE(Opportunity[Made Up ID], sum(Opportunity[Margin Conversion])))
Turns out my formula was correct and I had double counted (facepalm), however your formula worked!!! thanks again 🙂
@Jitmondo , Try measure like
Distinct Margin = SUMX(values(Opportunity[Id]), FIRSTNONBLANKVALUE(Opportunity[Made Up ID], sum(Opportunity[Margin Conversion])))
Thanks for coming back to me, unfortunately it didnt work, that formula allows one of the product categories (the one I mentioned having duplicates) to double count. Not sure why its doing that unless there is something else I have missed.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.