Count values in two columns

I have 2 enum columns in the same row. Both can have the value “A” or “B” or “C”.
In a VC I want to count how many times the value is “A”.

I have tried different expressions. They are all working. I also measured the sync time. But the results in the Performance Analyzer are not quite accurate, so I don’t really know which one is the fastest.
Maybe someone has insight on that?
Does anyone know a better solution?

Version 1

IFS(
	AND([Column1]="A",[Column2]="A"),2,
	OR([Column1]="A",[Column2]="A"),1
)

Version 2
IFS([Column1]="A",1)+IFS([Column2]="A",1)

Version 3

COUNT(LIST([Column1]="A")-LIST(FALSE))
+
COUNT(LIST([Column2]="A")-LIST(FALSE))

Version 4
COUNT(LIST([Column1]="A",[Column2]="A")-LIST(FALSE))
This one is not working if both columns have the value “A”, because -LIST() has the side effect of deleting duplicates. So in this case LIST(TRUE , TRUE) will get just LIST(TRUE).

1 9 280
9 REPLIES 9
Top Labels in this Space