Forum Discussion
TcT85
1 year agoHelper III
I need help with Distinct Count with excluding filter
Hi, I have two tables, and I need to find the yield for each type. The tables are fictional, the real table contains over 25 different names in the Type Column. I only know how to use with incl...
- 1 year ago
Hi TcT85
I included blank value in my table and now I get the following result
To fix that, I have to add the modify my formula with:
Yield =VAR TotalProduced =SUM('Produced Table'[Quantity])VAR DistinctDefects =CALCULATE(DISTINCTCOUNT('Defect table'[Serialnr]),FILTER('Defect table','Defect table'[Type] <> "Warning"&& 'Defect Table'[Type] <> ""))RETURNIF(TotalProduced > 0,1 - DIVIDE(DistinctDefects, TotalProduced),BLANK())
Because due to my test, the value was empty and not blankIf it is not working, you have to replace&& 'Defect Table'[Type] <> ""By&& 'Defect Table'[Type] <>BLANK()
bhanu_gautam
1 year agoSuper User
TcT85 , Create two measures
DAX
DistinctCountExcludingWarning =
CALCULATE(
DISTINCTCOUNT('Defect table'[Serialnr]),
'Defect table'[Type] <> "Warning"
)
Yield =
1 - DIVIDE(
[DistinctCountExcludingWarning],
SUM('Produced Table'[Quantity])
)