logo
search
Power Query Problems

Fix Excel Power Query Hanging When Filtering Text Dates with a Parameter

Phi Hung VoPhi Hung Vo Oct 10, 2026 868 views

Question details

The user needs to resolve an issue where Power Query freezes or takes an unusually long time when attempting to filter SQL Server tables using an Excel date parameter on a text-formatted date column.

How to Fix Power Query Hanging When Filtering Text Dates with a Parameter
Product
Excel Power Query / SQL Server
Device & OS
not provided
Scenario
Filtering SQL Server data where dates are stored as YYYYMMDD text strings using an Excel date parameter.
Observed behavior
Power Query hangs or appears to freeze during the filtering step on specific tables, failing to load or process the data efficiently.
Before you start

Before modifying your queries, save a backup of your Excel workbook and verify your active credentials and connection stability to the SQL Server database.

Solution 1Recommended

Convert Text Dates to Actual Date Values and Use a Date Parameter

Transforming your text-based date column into a proper Date data type ensures efficient filtering, enables query folding, and prevents Power Query from hanging.

When filtering dates formatted as text (like YYYYMMDD), Power Query often struggles to fold the query back to the SQL Server. This forces Excel to download the entire dataset into local memory before filtering, which causes the application to hang. Explicitly converting both the column and parameter to a 'Date' type resolves this memory bottleneck.

1
Change Column Data Type

Open the Power Query Editor. Select your text date column (e.g., YYYYMMDD), click the data type icon in the column header, and change it to 'Date'.

2
Configure the Parameter

Click 'Manage Parameters' in the Home tab. Ensure your filtering parameter is explicitly configured with the Data Type set to 'Date'.

3
Apply the Filter

Filter the newly converted date column using your parameter. In the Advanced Editor, ensure the code looks similar to: Table.SelectRows(Source, each [Date] > MyDate).

Convert Text Dates to Actual Date Values and Use a Date Parameter
Pro Tip: If you are reading the parameter directly from a cell in an Excel table, add a transformation step to explicitly change the imported cell value to a Date type before applying it to the filter.
Free Microsoft Office alternative

Try WPS Office for Fast and Lightweight Data Management

If heavy queries, complex M-code, and bulky data connections are slowing down your current spreadsheet application, consider switching to WPS Office. It provides a lightweight, highly compatible spreadsheet tool perfect for analyzing data without the bloat.

  1. 1. Download and Install: Visit the official WPS website to download and install WPS Office for free on your device.
  2. 2. Open Your Spreadsheets: Launch WPS Spreadsheets and click File > Open to seamlessly import your existing Excel files.
  3. 3. Analyze Data Smoothly: Use the familiar Data tab features to filter, sort, and analyze your datasets without performance lags.
Fully compatible with Microsoft Excel file formats, including .xls, .xlsx, and .csv.Lightweight architecture ensures fast loading and smooth data filtering without hanging.Familiar user interface requires zero learning curve for Excel users.Built-in advanced data analysis and visualization tools for everyday tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Power Query freeze when filtering text-formatted dates?

When filtering text-formatted dates against a date parameter, Power Query cannot translate the transformation into a native SQL query (a process called query folding). As a result, it attempts to download the entire SQL database table into local memory to perform the filter, which causes Excel to freeze or hang.

What is query folding in Power Query?

Query folding is the ability of Power Query to translate your applied data transformations into a single native database query (like a SQL statement). This allows the source database to do the heavy lifting, significantly improving performance and preventing hangs.

Can I pass an Excel cell value as a date parameter in Power Query?

Yes. You can import an Excel table containing your date value into Power Query. Drill down into the specific cell value to create a scalar variable, ensure you add a step to convert it explicitly to a Date data type, and then use that variable as a parameter in your SQL Server query filter.