Forum Discussion
Calculate the cost while ignoring duplicates
I'm sure this is easy but the logic escapes me.
In DAX, How would I ignore the duplicate while calculating the Cost?
| ID | Cost | Desired Result |
| 1 | 10 | 10 |
| 1 | 10 | |
| 2 | 50 | 50 |
| 2 | 50 |
Hi WorkHard
It would be easier to remove the duplicates in Poer Query. If you want the total cost without the duplicates, create a measure and place it in a card visual:
Measure = SUMX ( DISTINCT ( Table1[ID] ), CALCULATE ( MAX ( Table1[Cost] ) ) )Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
1 Reply
- AlB
Community Champion
Hi WorkHard
It would be easier to remove the duplicates in Poer Query. If you want the total cost without the duplicates, create a measure and place it in a card visual:
Measure = SUMX ( DISTINCT ( Table1[ID] ), CALCULATE ( MAX ( Table1[Cost] ) ) )Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers