Forum Discussion
Remove duplicates based on values from multiple cells
Hi Community,
We have dataset based on logs - here we would like to create a new column with a true/false value if the line is a duplicate.
We have UserID, LogTimeDate, LogTime, and number of logged lines.
The Dax query should check if there are more entries with the same date and number of logged lines, and if so, flag the line with a true/false marking.
How would we go about formulating such an query?
Inputs are much appreciated.
Good day.
/David
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 () )
16 Replies
- AnonymousNot applicable
Hi Dbjerring
Are you aware of query editor? I think you can use this tool to reach your goal.
Best,
Martin
- DbjerringRegular Visitor
Hi Anonymous,
Yes, but I'm not sure how to perform an advanced query like this - any tips?
/David
- v-chuncz-msftCommunity 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 () )