Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Measure - Sum distinct values another column ID

Hi,   Is there a good way to Sum these Distinct values in a measure? Similar toa measure similar to: Calculate(sum(Table[Amount Billed])) Calculate(sum(                 Table[Amount Billed])    ...
  • v-easonf-msft's avatar
    4 years ago

    Hi, Anonymous 

    There are too many duplicate data in your table.

    It is recommended to select columns ("Amount Billed", "Sales Tax", "Enviromental Charge") and then delete the duplicate values in "Transform Data",

    You can sum distinct values values based on the columns in the new table.

    You can also try formula as below:

    Total Amount Billed = 
    var tab=SUMMARIZE('Table','Table'[ID],'Table'[Amount Billed],'Table'[Sales Tax],'Table'[environment charge])
    return SUMX(tab,'Table'[Amount Billed])
    Total Sales Tax = 
    var tab=SUMMARIZE('Table','Table'[ID],'Table'[Amount Billed],'Table'[Sales Tax],'Table'[environment charge])
    return SUMX(tab,'Table'[Sales Tax])

    Please check my sample file for more details.

     

    Best Regards,
    Community Support Team _ Eason