Forum Discussion

WorkHard's avatar
WorkHard
Icon for Helper V rankHelper V
5 years ago
Solved

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
  • 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's avatar
    AlB
    Icon for Community Champion rankCommunity 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