Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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 the "Severity" column equals Major or Critical. For example based on the table below, the measure should equal 4 because it includes batches A, C, D, H, while excluding batches B and G.
I tried using the formula:
Solved! Go to Solution.
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/
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/
I have this exact same question, however, the provided answer does not Exclude, but includes only a few possible values. Let's say that 'Severity' could have any number of other values, other than the limited number of values in this example, how would you exclude one or more values (instead of writing something that only includes the other possibilities, as there are too many to account for in my scenario).
Thank you!
Hi VahidDM. This worked great, thank you for your prompt reply!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.