Forum Discussion
katto16
Helper I
3 years agoCount items that appear only once with condition
Hi. I'm trying to count the Unit IDs that appear only once & have the Overall Result of "pass" in Power BI. Sample data is as below. In this case, there's only 1 which is DS1111. Eventually, I ...
- 3 years ago
Hi, man katto16
Feel free to add me to your super user list:Column = var currentID = UniqueStaff[Unit ID] var currentResult = UniqueStaff[Overall Result] var CountOfRows = COUNTROWS(FILTER(UniqueStaff, UniqueStaff[Unit ID] = currentID)) var ReturnCheck = IF(CountOfRows = 1 && currentResult = "pass", 1, 0) return ReturnCheck
ddpl
Solution Sage
3 years agokatto16 ,
below calculated column may also get your result...
your need =
var ct = COUNTX(FILTER('Table', 'Table'[Unit ID] = EARLIER('Table'[Unit ID])), 'Table'[Unit ID])
return
IF(
ct = 1 && 'Table'[Overall Result] = "pass",
1,
0
)
although I'm not a super userπ
katto16
Helper I
3 years agoThis works great. Thanks for your very prompt help. I appreciate!