Forum Discussion
asodhani
8 years agoFrequent Visitor
How to create new column based on duplicate values
I want to create a column Duplicate Contracts . I use to do this in excel by B3 and B2 are row numbers for Contract Number for column. =IF((B3-B2)=0,"Duplicate","Not Duplicate") I cannot ...
- 8 years ago
Then just change the code from the original calculation I sent to use the name of the index column you just added where I have highlighted below.
Column = VAR CountOfRows = CALCULATE( COUNTROWS('Table1'), FILTER( 'Table1' , 'Table1'[Contract Number] = EARLIER('Table1'[Contract Number]) && 'Table1'[Index Column] > EARLIER('Table1'[Index Column]) ) )+0 RETURN IF(CountOfRows=0,"Not Duplicate","Duplicate")
Phil_Seamark
8 years agoMicrosoft Employee
This will be an issue for DAX. If the data in all columns is identical for multiple rows, the calculation will return the same.
Can you add an Index column to the data in the query editor? This will at least provide something for DAX to work with.
asodhani
8 years agoFrequent Visitor
Hi Phil_Seamark
I added a Index Column now. Please let me know if you have any further thoughts.
Thank you for your help to date.
Cheers
- Phil_Seamark8 years agoMicrosoft Employee
Then just change the code from the original calculation I sent to use the name of the index column you just added where I have highlighted below.
Column = VAR CountOfRows = CALCULATE( COUNTROWS('Table1'), FILTER( 'Table1' , 'Table1'[Contract Number] = EARLIER('Table1'[Contract Number]) && 'Table1'[Index Column] > EARLIER('Table1'[Index Column]) ) )+0 RETURN IF(CountOfRows=0,"Not Duplicate","Duplicate")- asodhani8 years agoFrequent Visitor