Forum Discussion
Remove duplicates based on values from multiple cells
- 9 years ago
You could modify the formula as shown below.
IsDuplicate = IF ( COUNTROWS ( FILTER ( Logs, Logs[LogCNumber] = EARLIER ( Logs[LogCNumber] ) && Logs[LogTime.1] = EARLIER ( Logs[LogTime.1] ) && Logs[LogID] < EARLIER ( Logs[LogID] ) ) ) > 0, TRUE (), FALSE () )
Hi Dbjerring
Are you aware of query editor? I think you can use this tool to reach your goal.
Best,
Martin
- Dbjerring9 years agoRegular Visitor
Hi Anonymous,
Yes, but I'm not sure how to perform an advanced query like this - any tips?
/David
- v-chuncz-msft9 years agoCommunity Support
You may use the following DAX to add a calculated column.
IsDuplicate = IF ( COUNTROWS ( FILTER ( Table1, Table1[UserID] = EARLIER ( Table1[UserID] ) && Table1[LogTimeDate] = EARLIER ( Table1[LogTimeDate] ) ) ) > 1, TRUE () )- Dbjerring9 years agoRegular Visitor
The DAX expression works, but for some reason both lines (also the the one without EARLIER value) gets tagged as TRUE.
So all lines with a possible duplicate gets TRUE VALUE.
Any thoughts?
The adjusted DAX calc I use:
IsDuplicate =
IF (
COUNTROWS (
FILTER (
Logs;
Logs[LogCNumber] = EARLIER ( Logs[LogCNumber] )
&& Logs[LogTime.1] = EARLIER( Logs[LogTime.1] )
)
)
> 1;
True();FALSE()
)
- Anonymous9 years agoNot applicable
Hi Dbjerring
You go to the menu on the left where there is 3 buttons, and choose the one called "Data". You then right-click your data and choose "Edit query". Then you right-click the column-header of the column where you want to remove duplicates and choose "Remove duplicates". Let me know if this solves your problem.
I'll also gladly elaborate.
- Dbjerring9 years agoRegular Visitor
Anonymous - I don't need to remove them, I have to tag them. And since it's based on values from two different cells, the remove duplicate function isn't enough. Thank you for your elaboration though.
Good day to you sir