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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi
Here is my sample data:
Customer Number | Amount |
| AA1 | 10 |
| AA2 | 25 |
| AA2 | 25 |
| AA2 | 25 |
| AA2 | 25 |
| AA3 | 100 |
| AA1 | 10 |
| AA1 | 10 |
| AA1 | 10 |
| AA1 | 10 |
| AA1 | 10 |
| AA1 | 10 |
| AA1 | 10 |
| AA1 | 10 |
| AA1 | 10 |
The Amount column is a repetative number and only value is needed but the dataset is provided as above.
What I am trying to accomplish:
I want to be able to produce a total amount that the customer has but only where the Customer Number is distinct. So if a Customer Number appears more than once I want to only include one amount value and disregard the remaining ones.
With regards to the table above, the correct amount total should be 135 but every DAX measure i try to produce will only ever show a total of 300.
Here is the code I thought would be sufficient but it is not working as I expected.
Distinct.Sum = CALCULATE( SUM( Table1[Amount] ) , DISTINCT( Table1[Customer Number] ))
As always, any assistance is greatly appreciated.
Paul
Solved! Go to Solution.
Hey,
Give this a try:
Distinct.Sum =
SUMX (
KEEPFILTERS ( VALUES ( Table1[Customer Number] ) ),
CALCULATE ( SELECTEDVALUE ( Table1[Amount] ) )
)
It might also be an idea to remove the duplicate values in Power Query, if you don't use them in your report yet. Then you can just take the SUM.
Hey,
Give this a try:
Distinct.Sum =
SUMX (
KEEPFILTERS ( VALUES ( Table1[Customer Number] ) ),
CALCULATE ( SELECTEDVALUE ( Table1[Amount] ) )
)
It might also be an idea to remove the duplicate values in Power Query, if you don't use them in your report yet. Then you can just take the SUM.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 101 | |
| 76 | |
| 56 | |
| 51 | |
| 46 |