Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I am trying to merge 2 tables with an outer left merge : table A with 54 rows, table B with 734 rows. All of the lines from table A are found and the merge has no issues. I did it with a few lines and had no error.
After an update on the data, when I try to expand the column of "Table B", I get an error row at the end of my table (so 55 lines)
The error is the following :
DataSource.Error :
(CreatedDate>2025-07-01T00:00:00+02:00) AND TRUE
^
ERROR at Row:1:Column:356
unexpected token: 'TRUE'
Détails :
[List]
The "CreatedDate" is a filter I added in the table B to filter the data. The filter workds correctly and I have no error in this table. I tried removed this filter and the error is still here, but with another filter that I can't remove at it is the one selecting the data I need to merge.
When I look at the "column quality" panel, I only see this : (an unexpected error occured)
I mostly want to know what can cause this issue to prevent it. I can solve the issue by deleting the last row, or add a sorted index before expanding, but it is a fix for the current data which doesn't guarantee that after an update, it will not comeback.
Solved! Go to Solution.
Hi @B_kaydo ,
This error is almost certainly caused by an issue with Query Folding. Power Query attempts to be efficient by translating your transformation steps, like filtering, into a single command that your data source can understand. In this instance, the translation process is failing and generating an invalid query containing ... AND TRUE. Your data source doesn't understand this broken command and sends back an error, which Power Query then displays as an extra row in your final table. This is why removing one filter just makes the error point to another; the underlying translation mechanism is the problem, not the filter itself.
To fix and prevent this, you need to strategically stop Query Folding right before the problematic step. The most reliable method is to force Power Query to load your filtered data from Table B into memory before the merge happens. This prevents it from attempting the faulty translation.
You can achieve this by editing your Table B query. Go to the last step in your "Applied Steps" panel, which is likely your filter step. Click the fx icon in the formula bar to add a new custom step. Then, enter the Table.Buffer function, referencing the name of your previous step. For example, if your last step was named "Filtered Rows", you would use the following code:
= Table.Buffer(#"Filtered Rows")
By adding this as the final step in Table B, you create a "snapshot" of the data in memory. When you return to Table A to perform the merge, Power Query will use this in-memory data instead of trying to generate a new folded query. This directly addresses the root cause of the error and ensures it won't reappear after a data refresh.
Best regards,
Hi @B_kaydo ,
This error is almost certainly caused by an issue with Query Folding. Power Query attempts to be efficient by translating your transformation steps, like filtering, into a single command that your data source can understand. In this instance, the translation process is failing and generating an invalid query containing ... AND TRUE. Your data source doesn't understand this broken command and sends back an error, which Power Query then displays as an extra row in your final table. This is why removing one filter just makes the error point to another; the underlying translation mechanism is the problem, not the filter itself.
To fix and prevent this, you need to strategically stop Query Folding right before the problematic step. The most reliable method is to force Power Query to load your filtered data from Table B into memory before the merge happens. This prevents it from attempting the faulty translation.
You can achieve this by editing your Table B query. Go to the last step in your "Applied Steps" panel, which is likely your filter step. Click the fx icon in the formula bar to add a new custom step. Then, enter the Table.Buffer function, referencing the name of your previous step. For example, if your last step was named "Filtered Rows", you would use the following code:
= Table.Buffer(#"Filtered Rows")
By adding this as the final step in Table B, you create a "snapshot" of the data in memory. When you return to Table A to perform the merge, Power Query will use this in-memory data instead of trying to generate a new folded query. This directly addresses the root cause of the error and ensures it won't reappear after a data refresh.
Best regards,
Hello @DataNinja777
Thank you very much for the explanation and the solution. I can confirm it solves my problem. I didn't knew about query folding. have a great day !