Fix Excel Power Query Hanging When Filtering Text Dates with a Parameter
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.

- 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 modifying your queries, save a backup of your Excel workbook and verify your active credentials and connection stability to the SQL Server database.
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.
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'.
Click 'Manage Parameters' in the Home tab. Ensure your filtering parameter is explicitly configured with the Data Type set to 'Date'.
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).

Verify Query Folding and Adjust Privacy Settings
If the query continues to hang after data type conversion, privacy level conflicts or broken query folding may be causing the performance degradation.
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. Download and Install: Visit the official WPS website to download and install WPS Office for free on your device.
- 2. Open Your Spreadsheets: Launch WPS Spreadsheets and click File > Open to seamlessly import your existing Excel files.
- 3. Analyze Data Smoothly: Use the familiar Data tab features to filter, sort, and analyze your datasets without performance lags.

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.




