Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Find duplicate column using max value fom another column and create a new column coded as 0 or 1

Hi, Need to create a new column which finds the duplicates and gives a one to those duplicates which has the highest value in a different column. If 2 duplicates have the highest value give 1 only t...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    Create a column as below.

    Column = 
    var _max = CALCULATE(MAX('Table'[Sales]),FILTER('Table','Table'[cust]=EARLIER('Table'[cust])&&'Table'[Report_month]=EARLIER('Table'[Report_month])))
    return
    IF('Table'[Sales]=_max,1,0)

     

    Best Regards,

    Jay