Forum Discussion
Anonymous
7 years agoNot applicable
Return1 value for multiple criteria
Hi there, Been stuck on this for a while and appreciate any input; I've a list of sales orders, with each order comprising of multiple order lines, and each order line can be pass or fail. ...
- 7 years ago
Hi Anonymous
For this test data, create two measures
fail n = CALCULATE(COUNT(Sheet5[status]),FILTER(ALLEXCEPT(Sheet5,Sheet5[order]),Sheet5[status]="fail")) flag = IF([fail n]>0,"fail","pass")
Add them in a table visual
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
7 years agoNot applicable
Unfortunately this shows which order line is pass or fail, but doesn't class an order as a whole as pass/fail (each order can contain both pass and fail lines, but if so, the order is failed).
tex628
7 years agoCommunity Champion
Measure =
VAR OrderNo = SELECTEDVALUE('Table'[OrderNumber])
Return
CALCULATE(
IF(SELECTEDVALUE('Table'[Status]) = "Pass" ; "Pass" ; "Fail" );
ALL('Table');
'Table'[OrderNumber] = OrderNo
)Try this instead! :-)
- Anonymous7 years agoNot applicable
this didn't work off the bat, and after changeing the last 2 semicolons with commas, it worked, but just gives a pass result, and no fails
- tex6287 years agoCommunity Champion
Anonymous Are you referring to my code?