Forum Discussion
MikePowerBI
4 years agoHelper II
Excluding values from distinct count based on another column
Hi there, I am looking to create a measure that counts the unique values of column "Batch" if the "Severity" column equals BLANK, Minor, or Event while also excluding the value from the count if...
- 4 years ago
Hi MikePowerBI
Try this measure:
Measure = VAR _A = CALCULATETABLE ( VALUES ( 'Table'[Batch] ), FILTER ( 'Table', 'Table'[Severity] IN { "", "Minor", "Event" } ) ) VAR _B = CALCULATETABLE ( VALUES ( 'Table'[Batch] ), FILTER ( 'Table', 'Table'[Severity] IN { "Major", "Critical" } ) ) VAR _C = EXCEPT ( _A, _B ) RETURN COUNTROWS ( _C )output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
VahidDM
4 years agoSuper User
Hi MikePowerBI
Try this measure:
Measure =
VAR _A =
CALCULATETABLE (
VALUES ( 'Table'[Batch] ),
FILTER ( 'Table', 'Table'[Severity] IN { "", "Minor", "Event" } )
)
VAR _B =
CALCULATETABLE (
VALUES ( 'Table'[Batch] ),
FILTER ( 'Table', 'Table'[Severity] IN { "Major", "Critical" } )
)
VAR _C =
EXCEPT ( _A, _B )
RETURN
COUNTROWS ( _C )
output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
MikePowerBI
4 years agoHelper II
Hi VahidDM. This worked great, thank you for your prompt reply!