Power Query Editor: Why do Text Filters Remove null Values?

Abstract: Resolve unexpected data loss by checking "Include nulls" in Power Query text filters to retain missing values.

Created: 2026-09-26 by

Text Filters in Power Query Editor remove null values because the interface defaults to excluding blanks and empty entries from boolean-based filters. This behavior is intentional, as nulls are treated as missing data rather than explicit text strings like "0" or "". To retain these values during filtering operations, you must explicitly check the "Include nulls" option within the filter menu before applying your criteria.

The Default Behavior of Text Filters

When you open the filter dropdown for a column containing text data in the Power Query Editor, you will notice that the list of items to select includes checkboxes next to each unique value. By default, the checkbox labeled "Include nulls" is often unchecked, or the system automatically excludes nulls when you apply specific text filters. This can be confusing for users who expect all rows to remain visible unless they are explicitly filtered out by name. The reason for this design lies in how Power Query handles data types and missing information. In database management and Excel integration, a null value represents an absence of data, distinct from an empty string ("") or zero (0). When you apply a filter such as "Contains 'John'", the engine evaluates every row against this condition. Rows with null values in the target column do not contain the string "John", nor do they contain any string at all. Consequently, they fail the logical test and are excluded from the result set. This exclusion is consistent across most filtering mechanisms in Power Query. Whether you use "Starts With", "Ends With", or "Equals", the evaluation logic treats nulls as non-matching entities. This ensures that your transformations focus on actual data presence, preventing errors that might arise from processing undefined values. However, for many analytical workflows, ignoring nulls entirely leads to incomplete datasets, making it crucial to understand how to manage them manually.

Distinguishing Nulls from Empty Strings

It is important to distinguish between a true null value and an empty string. A null indicates that no data exists for that cell, whereas an empty string is a text value of length zero. Power Query treats these differently in many functions. For instance, the Text.Length function returns 1 for an empty string but throws an error or behaves unexpectedly if applied directly to a null without handling. When filtering, both may appear visually similar in some views, but only nulls trigger the specific "Include nulls" toggle behavior in the UI. If you need to treat empty strings as valid data points, you should first replace them with a placeholder or convert them using Table.ReplaceValue before applying complex filters.

How to Retain Null Values During Filtering

To ensure that null values are not inadvertently removed when you apply text filters, you must interact with the filter dialog carefully. Follow these steps to preserve your complete dataset:
  1. Open the Filter Menu: Click the small arrow icon located in the header of the column you wish to filter. This opens the standard filter pane.
  2. Select Your Criteria: Check the boxes for the specific text values you want to keep, such as "Active" or "Pending". You can also use search or advanced filtering options here.
  3. Enable Null Inclusion: Before clicking OK, locate the checkbox labeled "Include nulls" at the bottom of the list. Ensure this box is checked. If it is unchecked, null values will be excluded from the final query output.
  4. Apply the Filter: Click the OK button. The query will now process only the selected text values along with any rows where the column contains null data.
If you find yourself frequently needing to include nulls, you might consider adjusting your workflow to handle nulls earlier in the transformation pipeline. For example, you could add a step that replaces nulls with a specific text marker like "Unknown" or "Missing". This allows you to filter on that marker just like any other text value, providing more predictable results. Alternatively, you can use the Table.SelectRows function in the Advanced Editor to programmatically control which rows are kept, offering greater flexibility than the GUI filter.

Impact on Data Manipulation and Downstream Steps

Excluding nulls prematurely can have significant downstream effects on your data model. Many DAX measures and Excel formulas rely on accurate counts of records. If nulls are filtered out early, your sum, average, or count calculations may be skewed because the denominator changes. For example, calculating the average sales per region might exclude regions with no recorded sales (nulls), artificially inflating the average. Furthermore, joining tables later in the process can become problematic. If one table has been filtered to exclude nulls while another retains them, join operations may yield unexpected results or lose data integrity. It is generally best practice to keep nulls intact until the final stage of your ETL (Extract, Transform, Load) process, unless you have a specific reason to discard missing data. This approach maintains the fidelity of your source data and allows for more transparent auditing of transformations. For related insights on managing data structures and formulas in Excel, you might find Using drop down lists, count formula, and conditional formatting in Microsoft Excel helpful for understanding how to visualize and analyze data once it has been properly cleaned. Additionally, resolving common formula issues like the INDEX-MATCH SPILL ERROR: How to Resolve and Prevent can complement your Power Query skills by ensuring accurate data retrieval after transformation.

Advanced Techniques for Null Handling

Beyond simple filtering, Power Query offers robust tools for managing nulls. The Fill Down and Fill Up commands are particularly useful for propagating non-null values into adjacent null cells, effectively cleaning up hierarchical data. You can also use Replace Errors or Replace Value to standardize how missing data appears. In the Advanced Editor, you can write custom M code to filter rows based on complex conditions involving nulls. For instance, using each [Column] <> null will explicitly exclude nulls, while each [Column] = null or [Column] = "Yes" will include them alongside specific values. Mastering these techniques provides finer control over your data quality and ensures that your reports reflect the true state of your information.

Frequently Asked Questions

Why does my Power Query show blank cells instead of null?

Power Query typically displays nulls as blank cells in the preview pane for readability. However, they are still treated as null data types internally. You can verify this by checking the data type icon in the column header; a null column will usually show a generic icon until you specify a type, whereas a text column will show "ABC".

Can I filter for both nulls and empty strings simultaneously?

No, the "Include nulls" checkbox specifically targets null values. Empty strings ("") are considered valid text content and are included by default if they match your other criteria. To filter for both, you would need to replace empty strings with nulls first using Table.ReplaceValue, then apply the filter.

Does filtering out nulls affect the performance of my query?

Filtering out nulls can slightly improve performance by reducing the number of rows processed in subsequent steps. However, the impact is usually negligible unless you are working with millions of rows. The primary consideration should always be data accuracy rather than minor speed gains.

How do I see the raw M code generated by the filter?

You can view the underlying M code by clicking the "Advanced Editor" button in the Home tab. Look for the Table.SelectRows step, which contains the logic for your filter. This allows you to modify the code manually to include or exclude nulls with precise syntax.

What happens if I accidentally exclude nulls and need them back?

If you have already applied the filter, you can simply go back to the "Applied Steps" pane on the right side of the Power Query Editor. Delete the step named "Filtered Rows" or click on it to edit the parameters. Re-check the "Include nulls" box and click OK to restore those rows.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More