cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper IV
Helper IV

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?

 

IDCostDesired Result
11010
110
25050
250
1 ACCEPTED SOLUTION

Accepted Solutions
Super User II
Super User II

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 

SU18_powerbi_badge

View solution in original post

1 REPLY 1
Super User II
Super User II

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 

SU18_powerbi_badge

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors