Forum Discussion
Anonymous
4 years agoNot applicable
COUNTROWS Function to exclude repeated value
hello Experts. I want to count the number of "Completed" Projects where the function will check if there is any repeat in Column "ID" and if there is any repeat then it will check if both "Status" f...
- 4 years ago
Hi,
Measure for 'Completed':
Completed := VAR MyTable = SUMMARIZE( 'Table', [ID], "ID Count", COUNTROWS( 'Table' ), "Completed Count", CALCULATE( COUNTROWS( 'Table' ), 'Table'[Overall ACL Status] = "Completed" ) ) VAR CompletedCheck = SUMX( MyTable, 0 + ( [ID Count] = [Completed Count] ) ) RETURN CompletedCheckRegards
- 4 years ago
Try:
Pending := VAR MyTable = CALCULATETABLE( VALUES( 'Table'[ID] ), 'Table'[Status] = "Pending" ) RETURN COUNTROWS( MyTable )Regards
Jos_Woolley
4 years agoSolution Sage
Hi,
Measure for 'Completed':
Completed :=
VAR MyTable =
SUMMARIZE(
'Table',
[ID],
"ID Count", COUNTROWS( 'Table' ),
"Completed Count", CALCULATE( COUNTROWS( 'Table' ), 'Table'[Overall ACL Status] = "Completed" )
)
VAR CompletedCheck =
SUMX( MyTable, 0 + ( [ID Count] = [Completed Count] ) )
RETURN
CompletedCheck
Regards
- Anonymous4 years agoNot applicable
Hello Jos_Woolley
Thank you for the help; this expression is not checking the duplicate numbers for the same status; as an example,87035 is three times in the ID column and only to IP_ID is Completed One Pending. so it (87035)should not return COMPLETE or be counted as complete as all 3 IP_IDs for 87035 is not complete.
- Jos_Woolley4 years agoSolution Sage
Not sure what you're doing, but the formula I posted does not consider 87035 as Completed. For the first dataset you posted it returns 1, since ID 87031 is the only ID which matches your criteria.
- Anonymous4 years agoNot applicable
Hi Jos Yes you are right thats what I want. let me run it again will let you know the result this time