How to Write Not Equal To in Power BI
Trying to exclude a specific piece of data from your Power BI report can feel surprisingly tricky. You know what you don't want to see, but telling DAX (Data Analysis Expressions) exactly that requires a specific operator. This guide will walk you through the simple and effective ways to write "not equal to" in Power BI, so you can filter your reports and calculations with precision.
Why "Not Equal To" is a Power BI Essential
In data analysis, filtering is everything. While we often focus on including specific data - like sales from a particular region or traffic from a certain campaign - excluding data is just as powerful. The "not equal to" operator helps you isolate the information you need by removing the noise.
Imagine you want to analyze the performance of all your marketing campaigns except for your evergreen "Brand Awareness" campaign. Or maybe you need to calculate total revenue from every country other than the United States. In these scenarios, simply filtering for what you want can be tedious. It's far more efficient to explicitly exclude what you don't want. This is where the magic of "not equal to" comes in handy, and DAX gives you two primary ways to do it.
Method 1: Using the "<>,</>" Operator
The most direct way to express "not equal to" in DAX is with the angle brackets operator: <,>,. Think of it as the mathematical symbols for "less than" (<,) and "greater than" (>,) combined, covering everything that isn't the specified value.
It’s the most common method you'll see in DAX formulas because it’s quick to type and easy to understand at a glance.
When to Use "<>,"
Use the <>, operator for straightforward comparisons where you are excluding a single, specific value. It’s perfect for simple filters in calculated columns and measures.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Example 1: Creating a Calculated Column
Let's say you have a 'Sales' table with a [Country] column. You want to create a new column called [Region] that labels sales as either "Domestic" if they are from the "USA" or "International" for all other countries.
Here’s how you’d use the <>, operator.
- Navigate to the Data view in Power BI and select your 'Sales' table.
- From the "Table tools" ribbon, click "New column."
- Enter the following DAX formula in the formula bar:
Region = IF(Sales[Country] <> "USA", "International", "Domestic")
In this formula:
IFchecks a condition and gives one result if it's true and another if it's false.Sales[Country] <> "USA"is the condition. It checks if the value in the [Country] column for the current row is not "USA".- If true (the country is anything other than "USA"), the formula returns "International."
- If false (the country is "USA"), it returns "Domestic."
Example 2: Creating a Measure
Using "not equal to" is even more powerful inside a measure, where it can dynamically filter your calculations. Suppose you want to create a card visual that shows total sales from all countries except Canada.
Here you would use the CALCULATE function combined with the <>, operator for your filter condition.
- Make sure you’re in the Report view.
- From the "Home" ribbon, click "New measure."
- Type this DAX formula:
Global Sales (Excluding Canada) = CALCULATE([Total Sales], Sales[Country] <> "Canada")
Let's break it down:
CALCULATEmodifies the context in which a calculation is made. It's the powerhouse of DAX.[Total Sales]is your base measure (e.g.,SUM(Sales[Amount])) that you want to calculate.Sales[Country] <> "Canada"acts as the filter.CALCULATEwill now only sum the sales amounts for rows where the country is not "Canada."
Now you can add this measure to a card, chart, or table, and it will always show the sales figures excluding Canada, regardless of other slicers or filters you have active (unless they conflict, of course).
Method 2: Using the NOT() Function
The second way to achieve the "not equal to" logic is by using the NOT() function. This function takes a logical expression (something that evaluates to true or false) and simply inverts it. So, if an expression is true, NOT() makes it false, and if it's false, NOT() makes it true.
To create a "not equal to" filter, you pair NOT() with the "equal to" operator (=).
So, Sales[Country] <> "Canada" is functionally identical to NOT(Sales[Country] = "Canada").
When to use NOT()
While it requires a little more typing for simple conditions, the NOT() function shines when you’re dealing with more complex logic, especially when you need to exclude multiple items or want to make your formulas more readable.
Example: Creating a Measure with NOT()
Let's rebuild our "Global Sales (Excluding Canada)" measure from before, but this time using the NOT() function.
- Create a new measure.
- Enter the following DAX formula:
Global Sales (Excluding Canada) v2 = CALCULATE([Total Sales], NOT(Sales[Country] = "Canada"))
The logic is the same: the inner part Sales[Country] = "Canada" checks if the country is Canada. The NOT() function then flips the result, effectively filtering for all countries that are not Canada. The outcome is identical to using <>, but this structure opens up more advanced possibilities.
Advanced Scenarios: Going Beyond Basics
The real power of DAX comes from combining functions. Here’s how "not equal to" logic handles more complex, real-world reporting challenges.
How to Exclude Multiple Values
What if you need to exclude several items at once? For instance, calculating total sales for all regions except North America (USA, Canada, and Mexico).
You could chain together expressions with the <>, operator:
FILTER(Sales, Sales[Country] <> "USA" && Sales[Country] <> "Canada" && Sales[Country] <> "Mexico")
This works, but it’s clumsy and hard to read. A much cleaner way is to combine the NOT() function with the IN operator.
The IN operator checks if a value is present within a list of values. By wrapping it in NOT(), you can easily filter for values that are not in the list.
Example: Excluding a List of Countries
Let’s write a measure to calculate sales, excluding North American countries.
Rest of World Sales = CALCULATE( [Total Sales], NOT(Sales[Country] IN {"USA", "Canada", "Mexico"}) )
This formula is much clearer and more efficient. It defines a list of countries {"USA", "Canada", "Mexico"} and uses NOT( ... IN ... ) to exclude all of them in a single, readable condition.
Dealing with Blanks
Blanks are a common source of confusion in Power BI. A "blank" is not the same as zero or an empty string (""). How does "not equal to" interact with them?
Generally, DAX treats blanks as a distinct state. For example, if you have rows where the [Campaign Name] column is blank, a filter like [Campaign Name] <> "Summer Sale" might include those rows with blanks, which may not be what you want.
If you want to exclude a specific value and any blank values, you need to be explicit. The best practice is to use the ISBLANK() function.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Example: Filtering Out Values and Blanks
Imagine you want to count all product sales that did not come from your "Online" sales channel, and you also want to ignore any sales where the channel information is missing.
CALCULATE ( COUNTROWS ( Sales ), Sales[Sales Channel] <> "Online", NOT ( ISBLANK ( Sales[Sales Channel] ) ) )
By adding NOT(ISBLANK(Sales[Sales Channel])) as a second filter condition to CALCULATE, you ensure that you are only counting rows where the sales channel is explicitly defined and is not "Online".
<,>, vs. NOT(): Which One Should You Choose?
For a beginner, the choice between <>, and NOT() might seem trivial, but adopting good habits early can make your reports easier to manage later on.
- For Simplicity: If you are excluding just one value,
<>,is perfectly fine. It's concise and universally understood in the world of data. - For Readability and Complexity: The
NOT()function starts to win when your logic gets more complex.NOT(Sales[Country] IN {"USA", "Canada"})is easier to read and less error-prone than chaining multiple<>,conditions. - For Flexibility:
NOT()is a function that wraps around other expressions, giving it more versatility. As you saw withNOT(ISBLANK()), it allows for more explicit and readable statements.
Our Recommendation: Start with <>, for quick and simple filters. As soon as you need to exclude a list of items or handle more nuanced logic, switch to using the NOT() function.
Final Thoughts
Mastering how to express "not equal to" in Power BI is a fundamental step toward building more insightful and specific reports. Whether you use the straightforward <>, operator for quick filters or the more flexible NOT() function for complex exclusions, you now have the tools needed to accurately slice your data and zero in on the information that truly drives decisions.
Of course, learning DAX syntax is one of the biggest hurdles in analysis, especially when all you want is a quick answer. Instead of trying to remember if you should use NOT(IN()) or multiple <>, conditions, we've made it possible to just ask for what you need in plain English. With Graphed, you can simply type, "Show me product sales for all channels except online," and it instantly creates the right chart for you, pulling directly from your live data sources without any DAX required.
Related Articles
Facebook Ads for Lawyers: The Complete 2026 Strategy Guide
Master Facebook ads for lawyers with this comprehensive 2026 strategy guide. Learn proven targeting, budgeting, and conversion tactics that deliver 200-500% ROI.
Facebook Ads for Moving Companies: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for moving companies in 2026. This comprehensive guide covers budget allocation, creative strategies, targeting, and optimization to generate more moving leads.
Facebook Ads for Auto Repair Shops: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for auto repair shops in 2026. Discover targeting strategies, budget recommendations, ad creative tips, and proven tactics to fill your appointment book consistently.