Others

Fix Azure DevOps OData Filters That Exclude Null Values

Aamir Naveed AkramAamir Naveed Akram Oct 26, 2026 869 views

Question details

The user needs to correct an Azure DevOps OData query that unexpectedly filters out records with null values when using a negative Contains condition.

Fix Azure DevOps OData Filters That Exclude Null ResolvedReason Values
Product
Azure DevOps OData
Device & OS
not provided
Scenario
Filtering work items via OData queries for reporting or data extraction.
Observed behavior
Work items with a null ResolvedReason are excluded from the dataset when a 'not Contains' filter is applied, despite different behavior occurring natively within Power BI.
Before you start

Verify the exact field name in your Azure DevOps environment and ensure you have permissions to test and modify the OData endpoint queries.

Solution 1Recommended

Explicitly Include Null Values in the OData Query

Modify your OData query URL to explicitly check for null values alongside your existing negative filter condition.

In OData, functions evaluated against null fields do not return standard boolean values that a 'not' operator can easily invert. To ensure unresolved work items or empty fields are captured, you must manually instruct the query to include null records.

1
Locate the existing filter

Find the OData query string where the negative filter is applied. For example, your query might currently contain: filter=not Contains(ResolvedReason,'As Designed').

2
Add the null check condition

Append an explicit check for null values on the targeted field using the 'eq' operator. For example: ResolvedReason eq null.

3
Combine and group the conditions

Use the 'or' operator to combine both conditions and wrap them in parentheses to prevent logical conflicts with other filters. The updated string should look like: filter=(ResolvedReason eq null or not Contains(ResolvedReason,'As Designed')).

4
Execute and verify

Run the updated OData query. Check your data output to ensure that records with empty or null ResolvedReason fields are now properly included in the returned dataset.

Explicitly Include Null Values in the OData Query
Logical Grouping: Always wrap combined OR conditions in parentheses to maintain the correct order of operations, especially when chaining with other AND conditions in your OData query.
Free Microsoft Office alternative

Analyze Your Exported Query Data Seamlessly with WPS Office

If you are exporting Azure DevOps query results to CSV or Excel formats for reporting, WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office for your data analysis needs.

  1. 1. Download and Install: Get WPS Office for free from the official website and install it quickly on your computer.
  2. 2. Open Exported Data: Launch WPS Spreadsheets and open your Azure DevOps CSV or Excel data exports.
  3. 3. Analyze and Report: Use familiar spreadsheet features like PivotTables and conditional formatting to analyze your work item data.
Fully compatible with Microsoft Excel (.xlsx) formats and CSV files exported from Azure DevOps.Lightweight software suite ensuring fast loading times for large datasets.Familiar spreadsheet interface that requires no learning curve to master.Built-in robust tools for pivot tables, data filtering, and advanced charting.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the 'not Contains' OData function exclude null values?

During OData evaluation, when a string function like 'Contains' encounters a null value, it often evaluates to null or undefined instead of false. Applying a 'not' operator to an undefined result does not make it true, causing the filtering engine to drop those records entirely.

Does Power BI filter null values the same way as Azure DevOps OData?

Not always. Power BI's internal data engine handles blank or null values differently and may gracefully include them when applying negative visual or page-level filters. This discrepancy is why an OData query might return different row counts compared to Power BI's native filtering.

Can I apply this explicit null fix to other Azure DevOps fields?

Yes. Anytime you use a negative filter (such as 'not eq' or 'not Contains') on a field that might be empty or unassigned, you should explicitly include an '[FieldName] eq null' check using an OR operator to guarantee accurate data retrieval.