Reputation: 15579
I've got a data-set such as:
OrderNumber PassFail
12345 fail
12345 pass
23456 pass
34567 pass
In Dax/PowerBI I want a measure that is distinct count of OrderNumber
s that have with no fail
records. So in the example above, that number would be 2: 12345
does not meet the criteria but the other two do.
Upvotes: 0
Views: 510
Reputation: 4346
measure=
countrows(
except(
summarize(
filter(tbl,tbl[PassFail]="pass"),
tbl[OrderNumber]
),
summarize(
filter(tbl,tbl[PassFail]="fail"),
tbl[OrderNumber]
)
)
)
Upvotes: 0
Reputation: 16918
You can check this measure-
pass_order_count =
var table_fail =
SELECTCOLUMNS(
FILTER(
your_table_name,
your_table_name[PassFail] = "Fail"
),
"OrderNumber" ,[OrderNumber]
)
var table_pass =
EXCEPT(
DISTINCT(your_table_name[OrderNumber]),
table_fail
)
return COUNTROWS(table_pass)
Upvotes: 1