Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have read the documentation on the calculate function but I am still not quite sure how the filter actually works, for example does what you put as a filter exclude everything else or only include what is in the filter?
For example if I want to count the total number of completed events in a particular category, but I want to exclude/filter out one specific event is this the correct way?
Solved! Go to Solution.
Hi @PowerAutomater
When using the Calculate function and you use Filter for example as in the above case it includes only the cases where Category is "Great Events" and Event Name is "Not Great Event"
If your goal is to exclude "Not Great Event" within the "Great Events" category, you should use:
CALCULATE(
COUNT(Query1[Completed]),
Query1[Category] = "Great Events",
Query1[Event Name] <> "Not Great Event"
)
Each filter in CALCULATE includes the matching rows, you would have to specify if equal to or not equal to.
To exclude, use the <> (not equal) operator
Using "," has the same effect as the AND operator (&&), for OR (||), you would have to specify this.
If Resolved, Mark as Solution to guide others!
Hi @PowerAutomater
When using the Calculate function and you use Filter for example as in the above case it includes only the cases where Category is "Great Events" and Event Name is "Not Great Event"
If your goal is to exclude "Not Great Event" within the "Great Events" category, you should use:
CALCULATE(
COUNT(Query1[Completed]),
Query1[Category] = "Great Events",
Query1[Event Name] <> "Not Great Event"
)
Each filter in CALCULATE includes the matching rows, you would have to specify if equal to or not equal to.
To exclude, use the <> (not equal) operator
Using "," has the same effect as the AND operator (&&), for OR (||), you would have to specify this.
If Resolved, Mark as Solution to guide others!
Thank you for that, I haven't come across <> before. Is this any different to adding a NOT in this way?
CALCULATE(COUNT(Query1[Completed]),Query1[Category] = "Great Events", NOT(Query1[Event Name] = "Not Great Event"))
Both these would give you the same result, it is just a couple of different ways to achieve the same.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.