Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

SUM only distinct values

Hello,

My table follows this structure:

CODE  DATE           QTD
AA12/12/2020   5
AA12/12/2020   5
AA26/12/2020   8
BB28/12/2020   2
BB31/12/2020   2

I would like to create a measure that makes the sum of distinct values ​​of the QTD column. So for the example above, the sum should be equal to 15 (5+8+2). And if I filtered by CODE=AA in my dashboard, it should be equals to 13 (5+8).

Can someone help me?

3 Replies

  • Anonymous , Try a measure like

    sumx(distinct(Table[QTD]), [QTD])

  • Hi, 
    I have a similar issue but based on the example above I'd like to SUM content of column B only once per unique row examined by the content of A column.




  • amitchandak how about if i want to sum distinct values for QTD based on their codes for the most recent date submitted?