Forum Discussion
RanjeetK
3 years agoHelper I
Count Duplicate records with multiple columns
Hello , i need help to solve following problem. i need count of Audit ID which are having duplicate records. Like every audit ID have a different Activity key but some of them are repeated EX :- 1...
- 3 years ago
Hey Hi All ,
I got solutionVar _Count = ADDCOLUMNS(SUMMARIZE(data,data[Audit ID],data[Activity ID],data[Activity RC Cycle]),
"@Count",CALCULATE(COUNTA(data[Activity RC Cycle]),ALLSELECTED(data[Audit ID]))
)Var _Greaterthan = FILTER(_Count,[@Count]>=2)
Var _Result = COUNTROWS(_Greaterthan)
RETURN
_Result
Shaurya
3 years agoMemorable Member
Hi RanjeetK,
Use the following formula to identify the records that are duplicates:
Count = SUMX('Table',IF('Table'[Audit ID]=EARLIER('Table'[Audit ID])&&'Table'[Activity ID]=EARLIER('Table'[Activity ID])&&'Table'[Activity RC]=EARLIER('Table'[Activity RC]),1))
Then summarize the original table after filtering out the non-duplicate rows:
Duplicates = SUMMARIZE(FILTER('Table','Table'[Count]>1),'Table'[Audit ID],'Table'[Activity ID],'Table'[Activity RC],"Measure",1)
Works for you? Mark this post as a solution if it does!
Consider taking a look at my blog: Forecast Period - Previous Forecasts